[Go to site: main page, start]

0% found this document useful (0 votes)
8 views6 pages

Java Interview Question

The document is a comprehensive list of questions covering various concepts in Java programming, including classes, objects, constructors, OOP principles, exceptions, collections, and basic programming tasks. It addresses fundamental topics like inheritance, polymorphism, and data structures, as well as practical programming exercises. This resource serves as a study guide for understanding Java and its core functionalities.

Uploaded by

gowdas0018
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)
8 views6 pages

Java Interview Question

The document is a comprehensive list of questions covering various concepts in Java programming, including classes, objects, constructors, OOP principles, exceptions, collections, and basic programming tasks. It addresses fundamental topics like inheritance, polymorphism, and data structures, as well as practical programming exercises. This resource serves as a study guide for understanding Java and its core functionalities.

Uploaded by

gowdas0018
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

Class/ Object

1.​ What is class & object


2.​ Explain class & object , give real time example explain
3.​ What is constructor ,What is real use of constructor
4.​ What is constructor overloading & why its required ?
5.​ What is constructor chaining
6.​ What is the use of this & super keyword
7.​ What is the use of this() & super() statement
8.​ How many ways, we can create an Object to Class ?
9.​ Explain the members of class
10.​Difference between static and non-static variable
11.​What is the use of class loader & garbage collector in JAVA
12.​ Can we have two main method in One JAVA class ?
13.​Can we declare constructor as private ? if yes Why ?
14.​Can we declare Class as private
15.​Can we declare Class as static
16.​How to terminate class execution in the RunTime
17.​Can I call Finalize() mtd explicitly ?
18.​What is the OutPut
public class MAVA_MINT {
​ static {
​ ​ mtd();
​ }
​ static void mtd() {
​ ​ [Link]("mtd");
​ }

​ public static void main(String[] args) {


​ }

19.​Can we have multiple class in one java File , if yes then what should be File
NAme
20.​In one File Multiple Class like A , B , C . all the class will have main method
Then which class will get execute
21.​What is the output of below program
Class A{
Static Int i=10
Public static void main (String a){
Int i=10.1;
[Link](j)
}
}
15 . what is the Output of below program
Int i=10;
Int j =20;
[Link](i++ + ++j + ++i + i-- + j++)

OOPS Concept
22.​List out the Oops concept of JAVA
23.​What is inheritance & advantages of inheritance
24.​Explain type of inheritance
25.​Explain multiple inheritance & why it is not possible,
26.​how to achieve multiple inheritance in java
27.​What is death of diamond
28.​Explain difference between overloading / overriding
29.​Explain overloading / overriding with real time example
30.​Can we overload operator in java
31.​Can we overload main() method in java, if yes which main() will get execute
32.​Can we override main() method in java ?
33.​Can we override private method in java ?
34.​Whether static method can inheritance?
35.​Whether static method can override?
36.​Can I accesses static variable using Object ?
37.​What is abstraction & abstract
38.​how many ways we can achieve abstraction
39.​Can we have constructor in abstract class?
40.​Can we have main method in abstract class?
41.​Can interface inherit object class?
42.​Can abstract class inherit object class?
43.​Which is the first statement inside the default constructor?
44.​Can interface have a constructor?
45.​Can interface have a main method?
46.​Can we achieve multiple inheritance by using a abstract class?
47.​Can we achieve multiple inheritance by using a interface?
48.​Can we achieve loose coupling by using abstract class and interface?
49.​Can we have a private abstract method in abstract class?
50.​Can we have static variables inside the interface?
51.​How do you achieve multiple inheritance in java by using interface?
52.​Explain the interface with real time example?

53.​What is exception?
54.​Difference between exception and error?
55.​Explain the types of exception?
56.​What the purpose is of try and catch block?
57.​Can we have a nested try blocks?
58.​Can we have a more than one finally block in a single program?
59.​What is the difference between throw and throws and throwable?
60.​What are custom exception? How to write custom exception?
61.​Which is super most class of exception?
62.​What are the inbuilt class present in java?
63.​What are the inbuilt methods are present in java?
64.​What is the difference between final, finally, finalize?
65.​List out the exceptions are available in java?
66.​What is early binding and late binding?
67.​What is wrapper class, List of the Wrapper class available in Java
68.​What is boxing & unboxing
69.​how to integer to String
70.​how to String to Integer
71.​What is primitive casting, types of primitive casting
72.​What of object casting Explain with example
73.​Explain Run time polymorphism with up casting example
74.​What is achieve down casting in java
75.​What is class CASTING exception & when will get ?
76.​What is Object class in Java
77.​Explain inbuilt class available in OBJECT class
78.​Can we create object array? What is the use of Object array
79.​Explain toString(). eqaul(), hashcode() mtd in Object class
80.​What is String class , why is required
81.​can we create object to final String class
82.​how many ways to create String object
83.​why String is immutable , Explain with program
84.​difference between Constant pool & non constant pool in String class
85.​Difference between equals() and == and compareTo() method in java?
86.​Difference between equals() and contains() method?
87.​Difference between stringbuffer and stringbuilder?
88.​Explain the inbuilt methods of String class?
89.​Explain public static void main(String[] args)?
90.​Explain [Link]()?
91.​Does arrays are objects in java?
92.​What is two dimensional array?
93.​What is jagged array?
94.​Can we declare array as a final?
95.​What is marker interface?
96.​What is serialization?
97.​What is deserialization?
98.​Which class do we need to use for a serialization?
99.​What are nested class?
100.​ Can we change the sequence of public static in main method?
101.​ What are command line arguments?
102.​ What are threads? How many ways to create a thread?
103.​ What is synchronization?
104.​ What is singleton class?
105.​ Why singleton class is required? Explain with real time example?
106.​ How to declare, create, and initialize array in single line?
107.​ What are the disadvantages of array?
108.​ Which is the default package in java?
109.​ What is the use of package?
110.​ What is the use of import keyword?
111.​ What are inbuilt packages are available in java?
112.​ Explain oops concepts with real time examples?
113.​ Difference b/n static and non-static.
114.​ W.A.P PALINDROME?
115.​ w.a.p for reverse number?
================================basic Programs==================
116.​ Armstrong number?
117.​ Prime number or not?
118.​ w.a.p to generate prime numbers between 1 to 1000?
119.​ w.a.p strong number?
120.​ Perfect number?
121.​ Summation of odd and even numbers?
122.​ Fibonacci?
123.​ Factorial?
124.​ Sum of digits?
125.​ Sum of 'n' natural numbers?
126.​ Bubble sort?
127.​ [Link]. to display 1 to 100 without using any loop?
128.​ Can a method return more than one value?if not how to return?
129.​ Sum of array elements?
130.​ Binary search?
131.​ w.a.p to find biggest and least element is present in the array?
132.​ w.a.p to reverse an integer array and display?
133.​ w.a.p to find duplicate elements in array?
134.​ Reverse string?
135.​ Reverse String using recursion
136.​ Reverse sentence?
137.​ Palindrome in string?
138.​ w.a.p to find length of the string without using length function?
139.​ .w.a.p to count number of vowels, space and digits present in the array?
140.​ w.a.p to find repeated characters are present in string?
141.​ w.a.p to find non-repeated characters in String?
142.​ Anagram?
143.​ w.a.p tp remove the space which is present in the sentence?
144.​ w.a.p to find to count the number of words present in the text file?
145.​ w.a.p to count commented line count available in text File?
146.​ All pattern programs?
147.​ Write a program to find the occurrence of character
148.​ Write a program to display words in reverse ?
149.​ w.a.p to find out whether the year is leap or not?
150.​ Addition of two matrix?
151.​ Transpose matrix?
152.​ Contagious array?

===============================Collections=====================

153.​ Difference between array and collection?


154.​ Difference between array and arraylist?
155.​ Difference between array and linkedlist?
156.​ Difference between arraylist and linkedlist?
157.​ Difference between arraylist and vector?
158.​ Difference between list and set?
159.​ Difference between set and map?
160.​ Difference between HashMap & TreeMap
161.​ Difference between hashset and linkedhashset?
162.​ Difference between treeset and treemap?
163.​ Difference between comparable and comparator?
164.​ What is the default size of arraylist?
165.​ How many cursors are available in java?
166.​ How arraylist is implemented?

167.​ Different between Collection & Collections


168.​ Write a program to Sort Array List
169.​ How to make a collection thread safe?
170.​ What is Queue and Stack, list their differences?
171.​ What is Comparable and Comparator interface?
172.​ What are different ways to iterate over a list?
173.​ Explain the Iterator internal implementation & how its Work
174.​ What is the difference between Iterator and Enumeration?
175.​ write a Program to reverse content of the Array List
176.​ write a Program to remove duplicate data from the array List without using
map & set

You might also like