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

Java and OOPs Interview Questions

Uploaded by

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

Java and OOPs Interview Questions

Uploaded by

manasiyadav1155
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Interview Questions

=====================================================

1. Basic Java
a. What is programming lang and different programming lang?

b. What is java?
c. What is project, package and Class in Java?

d. What is difference between JDK, JRE and JVM?


e. Explain history of Java?

f. What are the different features of Java?


g. Why java is platform independent?

h. What is WORA?
i. What are the applications?

j. What are the different editions?


2. Methods

a. What are methods and types?


b. What is the purpose of main method?

c. What if we don’t have main method in class?


d. What if we change sequence of keywords in main method?

e. Difference between static and non-static methods?


f. How we suppose to use static or nonstatic methods in class?

3. Datatypes
a. What are the different things required for storing data in Java?

b. What is DataTypes and types in java?


c. What is the purpose of Datatypes in java?

d. What are default values for each datatype?


e. What are default sizes of each datatype?

f. What if we don’t write datatype before variable


g. Difference between primitive and non-primitive datatypes?
4. Variables

a. What is variables and types of variables?


b. Why to use variables?

c. What you thing which one is the good approach to use variable or info
directly in program?

d. What is class variable?


e. What is instance variable?

f. What is access of local, static, and global variables?


g. What are default values of variables?

h. What is the need to variables?


5. Constructor

a. What is Constructor and different types of Constructors?


b. What is parameterized Constructor?

c. Does Constructor return any value?


d. What is the purpose of Constructor?

e. What is Constructor overloading?


f. What is Constructor chaining?

6. Operators
a. What is operator? And types of operators?

b. What is the purpose of operators?


c. What is difference between bitwise and logical operators?

d. What are assignment operators?


7. Control statements

a. What is controls statements and types in detail?


b. What is if else ladder with example?

c. What is difference between switch statement and if else ladder statement?


d. What is the difference between break and continue statements?
8. Loops statements

a. What is loop statement and types of loop statements?


b. When to choose for loop or while loop how will you identify?

c. Difference between while and do-while loop?


d. How you will understand which statement where to use?

9. General Questions –
a. Why java?

b. What is build in function and user defined functions?


c. What is initialization, declaration and uses? and roles.

d. What is Project?
e. What is package?

f. What is class?
=====================================================
=====================================================

10. Object
a. What is object?

b. Is java 100% object oriented programming lang.


c. What is OOP’s? And pillars/mechanism of OOP’s

d. What is use of new keyword?


11. Inheritance

a. What is inheritance? And different types? Advantages


b. What is the need of inheritance?

c. What is multiple inheritance? Is support in java or not?


12. Polymoripsm

a. What is Polymorphism, give example and how can we achieve it?


b. Can we achieve method overloading when the two methods have only

difference in return type?


c. Explain run time polymorphism and compile time polymorphism with

examples?
d. Can final methods be overloaded?

e. Can static methods be overloaded?


f. Can final methods be overridden?

g. Can static methods be overridden?


h. Can we overload a main method in Java?

i. Can we override the orverloaded methods?


j. Give difference for method overloading and overriding

13. Casting
a. What is casting? And different types?

b. What is primitive casting?


c. Why boolean casting not supported in java?

d. Explain upcasting?
e. Explain downcasting
14. Access Modifiers

a. What are access modifiers?


b. What do you thing which access modifier wide scope?

c. What is private, protected, default and public access modifiers?


15. Abstraction

a. What is abstraction? With examples


b. How to achieve abstraction?

c. What is the need of abstraction?


d. What is abstract class?

e. Difference between abstract method and non-abstract methods?


f. What is the purpose of concrete class?

g. What are the differences between abstract class and interface?


16. Interface

a. What is interface? With examples


b. What is an Interface and how it is different from Abstract Class?

c. Can we use private and protect access modifiers inside an Interface?


d. Can multiple inheritances supported in Interface?

e. What is implementation class?


f. Difference between concrete class and implementation class.

17. Encapsulation
a. What is encapsulation? With example

b. What is the purpose of encapsulation?


c. What are getter and setter methods?

d. How to make a read-only class in Java?


e. How to make a write-only class in Java?

18. General Imp -


a. Can we have multiple public classes inside a single class in Java?

b. Can we execute a class without a main method?


c. What is super and final keywords in Java and the difference between

them?
d. What is the purpose of using ‘this’ keyword in Java?

e. Final keyword
f. What is Final, Finally and Finalize?

g. Is Java case sensitive?


h. Which keyword is used for defining / creating a Class in Java?

i. What is the method from which Java Programs starts execution?


j. Give some examples for compile time errors in Java Programs?

k. What is the difference between print and println statements in Java?


l. What is Garbage Collection in Java and how exactly it is done?

m. How Constructors are different from Methods in Java?


n. What is the purpose of using Packages in Java?

o. What is the keyword used by a Java class to inherit the properties say
variables and methods of another Class?

p. How to access the variables and methods of another Class in Java?


q. Is Overriding applicable for Constructors in Java?

r. What happens when we specify the final non-access modifier with


variables and methods in Java?

s. What is the difference between abstract classes and interfaces in Java?


t. What is the keyword used for inheriting the interfaces in Java?

u. What is system.out.println();
=====================================================

You might also like