Interview Questions for java

Interview Questions for Java




Question : 1
What do you know about Java?

View Solution



Question : 2
What are the supported platform by Java Programming Language?

View Solution



Question : 3
List any five features of Java?

View Solution



Question : 4
Why is Java Architectural Neutral?

View Solution



Question : 5
How Java enabled High Performance?

View Solution



Question : 6
Why Java is considered dynamic?

View Solution



Question : 7
What is Java Virtual Machine and how it is considered in context of Java's platform independent feature?

View Solution



Question : 8
List two Java IDE's?

View Solution



Question : 9
List some Java keywords(unlike C, C++ keywords)?

View Solution



Question : 10
What do you mean by Object?

View Solution



Question : 11
Define class?

View Solution



Question : 12
What kind of variables a class can consist of?

View Solution



Question : 13
What is a Local Variable

View Solution



Question : 14
What is a Instance Variable

View Solution



Question : 15
What is a Class Variable

View Solution



Question : 16
What is Singleton class?

View Solution



Question : 17
What do you mean by Constructor?

View Solution



Question : 18
List the three steps for creating an Object for a class?

View Solution



Question : 19
What is the default value of byte datatype in Java?

View Solution



Question : 20
What is the default value of float and double datatype in Java?

View Solution



Question : 21
When a byte datatype is used?

View Solution



Question : 22
What is a static variable?

View Solution



Question : 23
What do you mean by Access Modifier?

View Solution



Question : 24
What is protected access modifier?

View Solution



Question : 25
What do you mean by synchronized Non Access Modifier?

View Solution



Question : 26
: According to Java Operator precedence, which operator is considered to be with highest precedence?

View Solution



Question : 27
Variables used in a switch statement can be used with which datatypes?

View Solution



Question : 28
When parseInt() method can be used?

View Solution



Question : 29
Why is String class considered immutable?

View Solution



Question : 30
Why is StringBuffer called mutable?

View Solution



Question : 31
What is the difference between StringBuffer and StringBuilder class?

View Solution



Question : 32
Which package is used for pattern matching with regular expressions?

View Solution



Question : 33
java.util.regex consists of which classes?

View Solution



Question : 34
What is finalize() method?

View Solution



Question : 35
What is an Exception?

View Solution



Question : 36
What do you mean by Checked Exceptions?

View Solution



Question : 37
What do you mean by Checked Exceptions?

View Solution



Question : 38
Explain Runtime Exceptions?

View Solution



Question : 39
Which are the two subclasses under Exception class?

View Solution



Question : 40
When throws keyword is used?

View Solution



Question : 41
When throw keyword is used?

View Solution



Question : 42
How finally used under Exception Handling?

View Solution



Question : 43
What things should be kept in mind while creating your own exceptions in Java?

View Solution



Question : 44
Define Inheritance?

View Solution



Question : 45
When super keyword is used?

View Solution



Question : 46
What is Polymorphism?

View Solution



Question : 47
What is Abstraction?

View Solution



Question : 48
What is Abstract class

View Solution



Question : 49
When Abstract methods are used?

View Solution



Question : 50
What is Encapsulation?

View Solution



Question : 51
What is the primary benefit of Encapsulation?

View Solution



Question : 52
What is an Interface?

View Solution



Question : 53
Give some features of Interface?

View Solution



Question : 54
Define Packages in Java?

View Solution



Question : 55
Why Packages are used?

View Solution



Question : 56
What do you mean by Multithreaded program?

View Solution



Question : 57
What are the two ways in which Thread can be created?

View Solution



Question : 58
What is an applet?

View Solution



Question : 59
An applet extend which class?

View Solution



Question : 60
Explain garbage collection in Java?

View Solution



Question : 61
Define immutable object?

View Solution



Question : 62
Explain the usage of this() with constructors?

View Solution



Question : 63
Explain Set Interface?

View Solution



Question : 64
Explain TreeSet?

View Solution



Question : 65
What is Comparable Interface?

View Solution



Question : 66
Difference between throw and throws?

View Solution



Question : 67
Explain the following line used under Java Program: public static void main (String args[ ])

View Solution



Question : 68
Define JRE i.e. Java Runtime Environment?

View Solution



Question : 69
What is JAR file?

View Solution



Question : 70
What is a WAR file?

View Solution



Question : 71
Define JIT compiler?

View Solution



Question : 72
What is the difference between object oriented programming language and object based programming language?

View Solution



Question : 73
What is the purpose of default constructor?

View Solution



Question : 74
Can a constructor be made final?

View Solution



Question : 75
What is static block?

View Solution



Question : 76
Define composition?

View Solution



Question : 77
What is function overloading?

View Solution



Question : 78
What is function overriding?

View Solution



Question : 79
Difference between Overloading and Overriding?

View Solution



Question : 80
What is final class?

View Solution



Question : 81
What is NullPointerException?

View Solution



Question : 82
What are the ways in which a thread can enter the waiting state?

View Solution



Question : 83
How does multi-threading take place on a computer with a single CPU?

View Solution



Question : 84
What invokes a thread's run() method?

View Solution



Question : 85
Does it matter in what order catch statements for FileNotFoundException and IOException are written?

View Solution



Question : 86
What is the difference between yielding and sleeping?

View Solution



Question : 87
Why Vector class is used?

View Solution



Question : 88
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?

View Solution



Question : 89
What are Wrapper classes?

View Solution



Question : 90
What is the difference between a Window and a Frame?

View Solution



Question : 91
Which package has light weight components?

View Solution



Question : 92
What is the difference between the paint() and repaint() methods?

View Solution



Question : 93
What is the purpose of File class?

View Solution



Question : 94
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

View Solution



Question : 95
Which class should you use to obtain design information about an object?

View Solution



Question : 96
What is the difference between static and non-static variables?

View Solution



Question : 97
What is Serialization and deserialization?

View Solution



Question : 98
What are use cases?

View Solution



Question : 99
Explain the use of sublass in a Java program?

View Solution



Question : 100
How to add menushortcut to menu item?

View Solution



Question : 101
Can you write a Java class that could be used both as an applet as well as an application?

View Solution



Question : 102
What is the difference between Swing and AWT components?

View Solution



Question : 103
What's the difference between constructors and other methods?

View Solution



Question : 104
Is there any limitation of using Inheritance?

View Solution



Question : 105
When is the ArrayStoreException thrown?

View Solution



Question : 106
Can you call one constructor from another if a class has multiple constructors?

View Solution



Question : 107
the difference between the methods sleep() and wait()?

View Solution



Question : 108
When ArithmeticException is thrown?

View Solution



Question : 109
What is a transient variable?

View Solution



Question : 110
What is synchronization?

View Solution



Question : 111
What is the Collections API?

View Solution



Question : 112
Does garbage collection guarantee that a program will not run out of memory?

View Solution



Question : 113
The immediate superclass of the Applet class?

View Solution



Question : 114
Which Java operator is right associative?

View Solution



Question : 115
What is the difference between a break statement and a continue statement?

View Solution



Question : 116
If a variable is declared as private, where may the variable be accessed?

View Solution



Question : 117
What is the purpose of the System class?

View Solution



Question : 118
List primitive Java types?

View Solution



Question : 119
What is the relationship between clipping and repainting under AWT?

View Solution



Question : 120
Which class is the immediate superclass of the Container class?

View Solution



Question : 121
What class of exceptions are generated by the Java run-time system?

View Solution



Question : 122
Under what conditions is an object's finalize() method invoked by the garbage collector?

View Solution



Question : 123
How can a dead thread be restarted?

View Solution



Question : 124
Which arithmetic operations can result in the throwing of an ArithmeticException?

View Solution



Question : 125
Variable of the boolean type is automatically initialized as?

View Solution



Question : 126
Can try statements be nested?

View Solution



Question : 127
What are ClassLoaders?

View Solution



Question : 128
What is the difference between an Interface and an Abstract class?

View Solution



Question : 129
What will happen if static modifier is removed from the signature of the main method?

View Solution



Question : 130
What is the default value of an object reference declared as an instance variable?

View Solution



Question : 131
Can a top level class be private or protected?

View Solution



Question : 132
Why do we need wrapper classes?

View Solution



Question : 133
What is the difference between error and an exception?

View Solution



Question : 134
Is it necessary that each try block must be followed by a catch block?

View Solution



Question : 135
When a thread is created and started, what is its initial state?

View Solution



Question : 136
What is the Locale class?

View Solution



Question : 137
What are synchronized methods and synchronized statements?

View Solution



Question : 138
What is runtime polymorphism or dynamic method dispatch?

View Solution



Question : 139
What is Dynamic Binding(late binding)?

View Solution



Question : 140
Can constructor be inherited?

View Solution



Question : 141
What are the advantages of ArrayList over arrays?

View Solution



Question : 142
Why deletion in LinkedList is fast than ArrayList?

View Solution



Question : 143
How do you decide when to use ArrayList and LinkedList?

View Solution



Question : 144
What is a Values Collection View ?

View Solution



Question : 145
What is dot operator?

View Solution



Question : 146
Where and how can you use a private constructor?

View Solution



Question : 147
What is type casting?

View Solution



Question : 148
Describe life cycle of thread?

View Solution



Question : 149
What is the difference between the >> and >>> operators?

View Solution



Question : 150
Which method of the Component class is used to set the position and size of a component?

View Solution



Question : 151
What is the range of the short type?

View Solution



Question : 152
What is the immediate superclass of Menu?

View Solution



Question : 153
Does Java allow Default Arguments?

View Solution



Question : 154
Which number is denoted by leading zero in java?

View Solution



Question : 155
Which number is denoted by leading 0x or 0X in java?

View Solution



Question : 156
Break statement can be used as labels in Java?

View Solution



Question : 157
Where import statement is used in a Java program?

View Solution



Question : 158
Explain suspend() method under Thread class>

View Solution



Question : 159
Explain isAlive() method under Thread class?

View Solution



Question : 160
What is currentThread()?

View Solution



Question : 161
Explain main thread under Thread class execution?

View Solution



Question : 162
Life cycle of an applet includes which steps?

View Solution



Question : 163
Why is the role of init() method under applets?

View Solution



Question : 164
Which method is called by Applet class to load an image?

View Solution



Question : 165
Define code as an attribute of Applet?

View Solution



Question : 166
Define canvas?

View Solution



Question : 167
Define Network Programming?

View Solution



Question : 168
What is a Socket?

View Solution



Question : 169
Advantages of Java Sockets?

View Solution



Question : 170
Disadvantages of Java Sockets?

View Solution



Question : 171
Which class is used by server applications to obtain a port and listen for client requests?

View Solution



Question : 172
Which class represents the socket that both the client and server use to communicate with each other?

View Solution



Question : 173
Why Generics are used in Java?

View Solution



Question : 174
What environment variables do I need to set on my machine in order to be able to run Java programs?

View Solution



Question : 175
Is there any need to import java.lang package?

View Solution



Question : 176
What is Nested top-level class?

View Solution



Question : 177
What is Externalizable interface?

View Solution



Question : 178
If System.exit (0); is written at the end of the try block, will the finally block still execute?

View Solution



Question : 179
What is daemon thread?

View Solution



Question : 180
Which method is used to create the daemon thread?

View Solution



Question : 181
Which method must be implemented by all threads?

View Solution



Question : 182
What is the GregorianCalendar class?

View Solution



Question : 183
What is the SimpleTimeZone class?

View Solution



Question : 184
What is the difference between the size and capacity of a Vector?

View Solution



Question : 185
Can a vector contain heterogenous objects?

View Solution



Question : 186
What is an enumeration?

View Solution



Question : 187
What is difference between Path and Classpath?

View Solution



Question : 188
Can a class declared as private be accessed outside it's package?

View Solution



Question : 189
What are the restriction imposed on a static method or a static block of code?

View Solution



Question : 190
Can an Interface extend another Interface?

View Solution



Question : 191
Which object oriented Concept is achieved by using overloading and overriding?

View Solution



Question : 192
What is an object's lock and which object's have locks?

View Solution



Question : 193
What is Downcasting?

View Solution



Question : 194
What are order of precedence and associativity and how are they used?

View Solution



Question : 195
If a method is declared as protected, where may the method be accessed?

View Solution



Question : 196
What is the difference between inner class and nested class?

View Solution



Question : 197
What restrictions are placed on method overriding?

View Solution



Question : 198
What is constructor chaining and how is it achieved in Java?

View Solution



Question : 199
Can a double value be cast to a byte?

View Solution



Question : 200
How does a try statement determine which catch clause should be used to handle an exception?

View Solution



Question : 201
What will be the default values of all the elements of an array defined as an instance variable?

View Solution



Question : 202
What is the difference between an Interface and an Abstract class?

View Solution



Question : 203
What is the purpose of garbage collection in Java, and when is it used?

View Solution



Question : 204
Describe synchronization in respect to multithreading.

View Solution



Question : 205
Explain different way of using thread?

View Solution



Question : 206
What is JDK?

View Solution



Question : 207
What is the significance of the .class file?

View Solution



Question : 208
How many classes can be declared in a Java program?

View Solution



Question : 209
How is the main() method invoked?

View Solution



Question : 210
How many classes can contain the main() method in a Java program?

View Solution



Question : 211
What is the out object?

View Solution



Question : 212
Why do you need to put an f' literal after a floating point constant?

View Solution



Question : 213
Does Java support multiple inheritance?

View Solution



Question : 214
Can I instantiate an interface?

View Solution



Question : 215
What is the return value of the getContentPane()method?

View Solution



Question : 216
What is the difference between a frame and a dialog box?

View Solution



Question : 217
Can you write a java code that works both as an applet and an application?

View Solution



Question : 218
Can I put more than one applet on a Web page?

View Solution



Question : 219
How do I determine the width and the height of my applet?

View Solution



Question : 220
Should applets have constructors?

View Solution



Question : 221
Why do I get RuntimeAccessPermission exception when I am trying to execute a Java program which will load an image?

View Solution



Question : 222
Why does my program not load the image even when the gif files are present in the specified directory?

View Solution



Question : 223
When do I need to flush an output stream?

View Solution



Question : 224
What is the advantage of Buffered streams over normal streams?

View Solution



Question : 225
How do I read a line of input at a time?

View Solution



Question : 226
What is meant by Serialization?

View Solution



Question : 227
Give two examples of real world objects. Also specify their characteristics and behaviour.

View Solution



Question : 228
What do you understand by state of an object? Explain with an example.

View Solution



Question : 229
How are objects implemented in Software?

View Solution



Question : 230
What is abstraction? How is encapsulation related to it?

View Solution



Question : 231
Define Encapsulation.

View Solution



Question : 232
Explain the term object using an example.

View Solution



Question : 233
What is Object Oriented Programming?

View Solution



Question : 234
Give a real life example of Polymorphism.

View Solution



Question : 235
What is Java API?

View Solution



Question : 236
Define the term Byte Code.

View Solution



Question : 237
What is JVM? Explain its relationship with byte code.

View Solution



Question : 238
What is a platform? How does it differ from a Java platform?

View Solution



Question : 239
State the difference between Applet and Application.

View Solution



Question : 240
What makes Java suitable to create secured applications?

View Solution



Question : 241
What does the Robust feature in Java mean?

View Solution



Question : 242
What is Multithreading in Java?

View Solution



Question : 243
What makes Java Architecture Neutral?

View Solution



Question : 244
What is WORA?

View Solution



Question : 245
Explain the statement “Byte code is the object code for the JVM”

View Solution



Question : 246
State two differences between fundamental and user-defined data type.

View Solution



Question : 247
State two differences between a class and an object.

View Solution



Question : 248
Why is a class called a user defined data type?

View Solution



Question : 249
What is an access specifier? Which two access specifier is used in a class declaration?

View Solution



Question : 250
Why is a class called an object factory?

View Solution



Question : 251
State two rules you should follow for naming a class

View Solution



Question : 252
What two conventions you should follow naming a class?

View Solution



Question : 253
State two conventions you should follow while naming a class.

View Solution



Question : 254
How are Decimal, Octal and Hexadecimal integer literals represented in Java?

View Solution



Question : 255
What are separators?

View Solution



Question : 256
What is Type Conversion? Name the two type conversions in Java.

View Solution



Question : 257
What is an operator? How is the classification of operators based upon?

View Solution



Question : 258
What is an expression?

View Solution



Question : 259
What is an accumulator?

View Solution



Question : 260
What is a bug? What is debugging?

View Solution



Question : 261
What are the different type of errors that may occur in a Java program?

View Solution



Question : 262
What are syntax errors? Give two examples.

View Solution



Question : 263
What are run-time errors? Give two examples.

View Solution



Question : 264
What are comments? Name the different types of comments used in Java.

View Solution



Question : 265

Give two examples of real world objects. Also specify their characteristics and behaviour.

View Solution



Question : 266

What is the difference between break and continue statements when they occur in a loop?

View Solution



Question : 267

State one similarity and one difference between while and for loop.

View Solution



Question : 268

Name two jump statements and their use

View Solution



CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad