0% found this document useful (0 votes)
9 views

pr-java

Uploaded by

island.workp1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

pr-java

Uploaded by

island.workp1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.What is java?

Java is a high-level, object-oriented programming language used for building applications


that run on multiple platforms. It is known for its portability, scalability, and robustness.

2.What are the main features of java?

The main features of Java are: platform-independent, object-oriented, secure, robust,


multithreaded, high-performance, and dynamic.

3. Explain the difference between JDK, JRE, and JVM.

JDK: Java Development Kit, includes tools for developing Java programs (e.g., compiler).

JRE: Java Runtime Environment, contains JVM and libraries to run Java programs.

JVM: Java Virtual Machine, executes Java bytecode on any platform.

4. What are the access modifiers in Java?

Access modifiers in Java are keywords that define the visibility or accessibility of classes,
methods, and variables.

Public: Accessible everywhere.

Private: Accessible only within the class.

Protected: Accessible within the package and subclasses.

Default: Accessible within the package.

5.what are principles of oops?

Encapsulation, inheritance, ,polymorphism,abstraction.

6.what is inheritance? Types

7.what is polymorphism types ?

8.what is encapsulation?

9.what is abstraction?

10.what is interface?

11.what is constructor? Types.

A constructor is a special method used to initialize objects.


Default Constructor: No parameters.

Parameterized Constructor: Takes parameters to initialize fields.

12.What is this and super keyword in java ?

This: Refers to the current object of the class. It is used to access instance variables,
methods, or constructors.

Super: Refers to the parent class object. It is used to access parent class methods,
variables, or constructors.

13.Final keyword?

The final keyword in Java makes things constant or unchangeable:

1. Final variable: Value cannot be changed.


2. Final method: Cannot be overridden.
3. Final class: Cannot be extended.

14.static keyword?

The static keyword in Java is used for variables and methods that are shared by all
instances of a class. You can access them without creating an object of the class.

15.what is main method?

The main method is the entry point for Java programs.

16.what is package?

17.what is exception?

18. What is exception handling?

19.what is try, catch, finally?

20.what is throw?

21.what is throws?

22.what is multi threading?


Running multiple threads (lightweight processes) concurrently to achieve parallelism.

23.what is thread?

24.what is thread synchronization?

Synchronization prevents thread interference by allowing only one thread to access a


critical section at a time.

You might also like