Features of Java
Java Buzzwords
A list of the most important features of Java language are given below;
- Simple - a very easy to learn, and it's syntax is simple, clean, and easy to understand.
- syntax based on C++
- Java has removed many complicated and rarely used features like explicit pointers, operator overloading, etc..
- There is no need to remove unreferenced objects because there is an automatic garbage collection in java.
- Object-oriented - everything is an object. Object 0riented means we organize our software as a combination of different types of objects that incorporates both data and behavior.
- Object - the physical as well as logical entity, whereas a class in java is the logical entity only. An entity that has state and behavior is known as an object - chair, bike, marker, table, car, etc... It can be physical or logical(tangible and intangible). The example of an intangle object is the banking syste
- An object has three characteristics:
- State: represents the data(value) of an object.
- Behavior: represents the behavior(functionality) of an object such as deposit withrdraw, etc..
- Identity: An object identity is typically implemented via a unique ID. The value of the ID is not visible to the external user. However, it is used internally by the JVM to identify each object uniquely.
- For example, Pen is an object.
- name is Parker
- State - color is white
- behavior is writing.
- An object is an instance of a class. The class is a template or blueprint from which objects are created. So an object is an instance of a class.
- State: represents the data(value) of an object.
- Class - A group of objects that have common properties. It is a template or blueprint from which objects are created. It is a logical entity. It can't be physical.
- A class in Java can contain
- Fields
- Methods
- Constructors
- Blocks
- Nested Class and Interface
- Instance Variable in Java
- A variable which is created inside the class but outside the method is known as an instance variable.
- Instance variable doesn't get memory at compile time.
- It gets memory at runtime when an object or instance is created.
- That is why it is known as an instance variable.
- Method in Java
- A method is like a function which is used to expose the behavior of an object
- Code Reusability
- Code Optimization
- A method is like a function which is used to expose the behavior of an object
- A class in Java can contain
- Inheritance
- Abstraction
- Encapsulation
- Abstraction
- An object has three characteristics:
- Object - the physical as well as logical entity, whereas a class in java is the logical entity only. An entity that has state and behavior is known as an object - chair, bike, marker, table, car, etc... It can be physical or logical(tangible and intangible). The example of an intangle object is the banking syste
- Platform independent
- secured
- robust
- architecture neutral
- Interpreted.
- high performance
- mult-threaded
- distrubted
- dynamic/