Java is an object-oriented programming (OOP) language, meaning it organizes its design around objects (as opposed to functions and logic). An "object" is an entity with a unique identity (i.e., a label), characteristics (sometimes called "state"), and behavior.
There are four fundamental principles in the development of OOP. These are:
Encapsulation is a condition achieved when an object's state is private, enclosed within its class (a template with similar properties that developers use to create objects), and cannot be accessed by public functions .
Abstraction occurs when objects only expose the key details that you need to work with them (making your program development easier).
Inheritance occurs when objects are structured into parent and child structures, sharing a common logic without needing to be identical .
Polymorphism is a way of using child classes as their parent class without altering the child class.
When using OOP, many developers also rely on the SOLID principles of development (coined by Robert Martin or “Uncle Bob”). The SOLID principles include:
S : The Single Responsibility Principle says that only one class should be responsible for a problem (unless the problem is solved by interconnected subsystems).
O : The Open-Closure Principle says that you should extend, but not modify entities (i.e., functions, modules, and classes).
L : The Liskov substitution principle says that you should be able to replace superclasses with subclasses without breaking code.
I : The Interface Segregation Principle says that you should create a different interface for each client.
D : The Dependency Inversion Principle, which says that higher-level modules should not support lower-level ones.
Java vs. JavaScript
Because Java and JavaScript have similar names, many new developers often confuse them. However, they are distinctly different languages. Java is a compiler language, meaning it is translated into machine switzerland whatsapp number data code by compilers. In contrast, JavaScript is an interpreted scripting language, meaning it is translated into machine code when executed.
Java and JavaScript also have different uses. Developers mainly use Java for server-side development and JavaScript for client-side projects.
Java Developer vs. Software Engineer
New developers also confuse Java developers with software engineers, although these professions are also different. Java developers are highly specialized professionals who (usually) only work with Java projects.
Software engineers, on the other hand, have a broader skill set to work across different programming languages and projects. Because Java developers and software developers have similar roles and skills, many professionals move between roles for variety, a new challenge, or to learn new skills.
What is Object Oriented Programming?
-
- Posts: 126
- Joined: Mon Dec 23, 2024 4:07 am