Java is object-oriented, platform-independent, Multithreaded, and portable programming language.
it provides its own JRE and API.
2.What is the difference between JDK, JRE, and JVM?
JVM
Java Virtual Machine provides the runtime environment
JVM converts Java bytecode into machine language
JRE
Java Runtime Environment make java program to run
It contains the class libraries, loader class, and JVM.
JRE provide the runtime environment.
JDK
Java Development Kit contains tools can write Java programs and JRE to execute them.
It includes a compiler, Java application launcher
JDK includ JRE and JVM
3. What is Object-Oriented?
object-oriented programming is about creating objects that contain both data and methods.
advantages
OOP is faster and easier to execute
we don’t need to repeat
The code easier to maintain, modify and debug
OOP can reuse before code and reduce development time
4. What is Multithreaded?
programs can deal with many tasks at once
programs doesn’t occupy memory for each thread and share a common memory area.
5.What are the various access specifiers in Java?
access specifiers are used to define the access scope of the method, class, or a variable Public The classes, methods, or variables are defined as public, it can be accessed by any class or method. Protected Protected can be accessed by the class of the same package, or by the sub-class of this class, or within the same class. Default Default are accessible within the package only. Private private can be accessed within the class only.
6. What is the purpose of static methods and variables?
The methods or variables defined as static are shared among all the objects of the class.
The static is the part of the class and not of the object.
The static variables are stored in the class area, and we do not need to create the object to access such variables.
7. What are the advantages of Packages in Java?
Packages avoid the name clashes.
The Package provides easier access control.
We can also have the hidden classes that are not visible outside and used by the package.