Core Java is the foundation of every Java role. Before frameworks such as Spring Boot, you need to be comfortable with classes, objects and methods.
Classes and objects
A class describes a type of thing, such as an Employee, with its data and behaviour. An object is one real instance, created with the new keyword.
Methods
A method is a block of code inside a class that performs an action, such as calculating a salary. Methods can take input values and return a result.
The four ideas of object-oriented programming
- Encapsulation: keep data private and expose methods to use it.
- Inheritance: a class can reuse and extend another class.
- Polymorphism: the same method call can behave differently for different objects.
- Abstraction: show only what a user of the class needs.
Practise
Write an Employee class with private fields, a constructor and a method that returns a formatted description. Then create a Manager class that extends it.
Next step: see our Java Full Stack course at ScholarLogic, or book a free demo class. A counsellor will share the fee and the next batch dates.
