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

Keshav Sir Imp Java Questions

Uploaded by

svdarshangowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Keshav Sir Imp Java Questions

Uploaded by

svdarshangowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

JAVA QUESTIONS

Set 1:
1. What is class?
2. What is object or instance of class?
3. What is Member variables, how it is different from local variables
4. What is static variables? explain
5. What is non-static variables or instance variables? explain
6. How to access static members? Explain
7. How to access non-static members of class? Explain
8. How to create an instance of class? Explain
9. What are the difference between static and non-static members of class
10. Give example when to use static variables and non-static variables
11. What is reference variables? How to create it?
12. What is primitive variables in java? how to declare it?
13. What is non-primitive variables in Java? how to declare it?
14. Explain how many ways member variables can be initialized?
15. explain static blocks and non-static blocks
16. What is constructors? why it is required?
17. Does every class has constructor?
18. What is default constructor?
19. What is parameterized constructor?
20. What is user defined constructor?
21. What is constructor Overloading?explain its benefit
22. Explain this keyword, what it contains and how it is useful
23. Explain this() statement, explain why it is required?
24. Does constructor has return type?
25. What does new operator used for and what it returns
26. Does java supports pass by reference? why
27. Does constructor be static?
28. Does constructor be inherited?
29. Can we delcare constructor as private?
30. What is the access of default constructor?
31. Can we override Constructor of class?
32. What is constructor calling or constructor chaining?
33. Explain super() statement, explain why it is required?
34. what is the difference between this() and super()
35. Explain super keyword, what is the use of it?

CONTACT: 7760200900/9686800919 FACULTY: MR. KESHAVA EARA


36. What is the difference between super and this keyword
37. Explaing final member variables and how to initialize?
38. Give example when to use final instance variable?
39. Explaing Has-A relationship? how to achive it?
40. Explain what you mean by static reference variable? same as static variables
41. Explain what you mean by instance reference variable? same as member variables
42. What is inheritance? explain its advantages
43. What are the types of inheritance? Explain
44. Why does java doesn't support multiple inheritance?
45. What is super class or base class?
46. What is sub class or derived class?
47. Which members of super class can be inherited to sub class which access specifies can
48. Can we inherit Constructor of super class?
49. What is the role of Constructor in inhertiance?
50. From which super class the sub class cann't inherit?
51. If super class has private constructor, can sub class inherit its members?
52. What is implicit constructor call and explicit constructor call?
53. When to go for explicit constructor call?
54. What is method overloading? Explain
55. When to go for Method overloading? give real time examples
56. Can sub class overload the methods of super class?
57. Can we overload main method?
58. What is benefit of method overloading?
59. What is method overriding? Explain,give real time examples
60. What is the benefit of method overriding?
61. Which methods of super class can be overrided and which can't be overrided?
62. What do you mean by declaring instance method as final?

CONTACT: 7760200900/9686800919 FACULTY: MR. KESHAVA EARA


Set 2:
1. What is datatype casting? Explain its types
2. What is classtype casting? Explain its types
3. What is the pre-requiste to do class casting?
4. What is widening operation?
5. What is narrowing operation?
6. What is upcasting?
7. What is downcasting?
8. What is ClassCastException?When it occurs?
9. What is the reason for ClassCastException?
10. What is the use of instanceof operator in java?
11. When to perform downcasting?
12. Why we need class type casting?
13. What is polymorphism? Explain its types
14. What is runtime polymorphism? how to achieve it?
15. What is the uses of ploymorphism?
16. How to access general properties and how to access specialized properties?
17. what is abstract method?
18. What is abstract class?explain its members
19. Can we create instance of abstract class
20. What the subclass should do if it extends from abstract class
21. Can we define constructor in abstract class?
22. How to access the instance members of abstract class?
23. Does abstract class must have abstract method?
24. Is abstract class pure abstract body?
25. What is interface? explain its characteristics?
26. Can we create instance of interface?
27. What is implementation class?
28. What must a class should do if it implements an interface?
29. How many interface a class can implement? why
30. Does interface has constructor?
31. Can an interface extend another interface?
32. Can an interface extend from a class?
33. What is default access in interface?
34. What is default access in class?
35. What must be the access of method in class which implements an interface?Why
36. Can we declare reference variable of interface? what we can assign?
37. What is benefit of interface ?
38. What is marker interface?
39. abstract keyword can't be combined with which keywords, why?
40. Can a class extend another class and implement interface? explain
41. What is abstraction? how to achieve it?
42. What is the benefit of abstraction?
43. What is encapsulation?

CONTACT: 7760200900/9686800919 FACULTY: MR. KESHAVA EARA


44. What are the access specifier provided in java?
45. What is the use of private member variables?
46. What is the difference between package level and protected members?
47. What is package?How to declare it?
48. What is the use of import statement?
49. What is static import statement?
50. What is java bean class? where it is used?
51. What is Singleton class? Where it is used?
52. What is inner class? What are the types of inner class
53. What are the difference between abstract class and interface?

Set 3:

1. What are the members of Object class?


2. Explain toString(), hashCode() and equals() method of Object class
3. Why we need to override toString()?
4. Why we need to override hashCode() and equals();
5. What is String in java?
6. What is immutable object?
7. What are types of creating String object?
8. Explain Constant pool and non constant pool?
9. Explain difference between StringBuilder and StringBuffer class?
10. What are classtype arrays?
11. What is an exception? Explain types of Exception
12. What is checked Exception? give examples
13. What is the use of throw keyword?explain
14. What is the use of throws keyword and how it is different from throw
15. What is Throwable class?
16. What is RuntimeException class?
17. Explain try-catch block
18. Explain finally block
19. Explain Generic handler and specific handler
20. What is the difference between Exception and Error?
21. What is printStackTrace()?
22. What is custom Exception or user defined Exception?
23. Explain Java Exception Hierarchy
24. What is the difference between checked and unchecked exception?
25. What is the difference ClassNotFoundException and NoClassDefFoundError?
26. Can we write try block without catch block?

CONTACT: 7760200900/9686800919 FACULTY: MR. KESHAVA EARA


27. What is the use of multi catch block?
28. What is a Collection? Explain its benefit
29. What are the types of Collection?
30. Explain methods of Collection interface?
31. What is List ? explain its features
32. Explain the methods of List interface.
33. What are the types of List?
34. Explain ArrayList features?
35. What is the implementation data structure of ArrayList?
36. What are the constructors present in ArrayList?
37. How many interfaces ArrayList implements?
38. How to convert ArrayList to List and ArrayList to Collection?
39. How ArrayList grows dynamically?
40. When to use ArrayList?
41. Explain LinkedList? and its implementation data structure
42. How many interfaces LinkedList implements?
43. What are the difference between ArrayList and LinkedList?
44. Explain vector and its features
45. Explain how to sort elements of ArrayList?
46. How to get Synchronized List?
47. What is the set? Explain its features?
48. What are the types of Set?
49. Explain HashSet implementation in detail
50. Explain LinkedHashSet implementation in detail
51. Explain TreeSet implementation in detail
52. List the difference between HashSet, LinkedHashSet and TreeSet
53. Which Set is SortedSet?
54. What is NavigableSet?
55. What is Queue? Explain its features
56. Explain PriorityQueue implementation in details
57. How Set maintains no duplicate explain in details
58. Why should we override hashCode() and equals()
59. What is Comparable interface?
60. What is Comparator interface?
61. Explain constructors of HashSet?
62. Explain constructors of TreeSet
63. How to convert Set to Collection?
64. How to convert Set to any list like ArrayList?
65. What is Map? Explain how object are stored in Map
66. Explain important methods of Map?
67. Explain how to use Iterator on Map?
68. Explain types of Map in details
69. What is HashMap and explain its implementation
70. What is Hashtable and explain its implementation

CONTACT: 7760200900/9686800919 FACULTY: MR. KESHAVA EARA


71. What is SortedMap, give example
72. Explain TreeMap
73. What is Iterator? how to use it?
74. What is ListIterator? how to use it?
75. Explain methods of Collections class
76. Explain why we need Comparable interface?
77. Expain difference between Comparable and Comparator interface?
78. What is a Thread?
79. Explain Thread properties
80. How to create a thread and start the thread
81. Explain thread started by JVM
82. What is the difference between start() and run()
83. Explain methods provide by the thread to use thread properties
84. What is Thread priority? what are the range and what is default priorty
85. Explain the constructors of Thread
86. What is Runnable interface?
87. How to make Runnable type object to run as a thread in JVM
88. Explain join() method of thread class?
89. What is Thread Safe? how to achieve?
90. What is object lock? when it get created?
91. Waht is class lock ? when it get created?
92. How to get reference to current running thread?
93. What is thread deadlock?
94. Explain how to overcome thread deadlock?
95. Explain what is interthread communication and how to achieve it?
96. Explain wait() and wait(time) methods? where is the implementation of it?
97. Explain notify() and notifyAll() methods?where is the implementation of it?
98. What is thread synchronization?
99. What is the difference between user thread and deamon thread?
100. How to pause execution of current thread?
101. What are the difference between wait() and sleep()?
102. What is thread deadlock? how to avoid deadlock situation
103. What are different states of in life cycle of a thread?
104. What is Object Serialization?
105. What is Object de-serialization?
106. What is transient keyword in java?
107. What is Garbage collection? explain?
108. What is the use of finalize(), in which class it is present?
109. What is Garbage Collector?

CONTACT: 7760200900/9686800919 FACULTY: MR. KESHAVA EARA

You might also like