Java Questions And Answers
Here you can find Java Questions and Answers.
Why Java Questions and Answers Required?
In this Java Questions and Answers section you can learn and practice Java Questions and Answers to improve your skills in order to face technical inerview conducted by organisations. By Practicing these
interview questions, you can easily crack any Exams interview.
Where can I get Java Questions and Answers?
AllIndiaExams provides you lots Java Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Java Questions and
Answers as PDF files and eBooks.
How to solve these Java Questions and Answers?
You no need to worry, we have given lots of Java Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Competitive Exams interview.
Java Questions and Answers - Chapters
- Data Types Questions & Answers
- Operators Questions & Answers
- Applets Questions and Answers
- Arrays Questions and Answers
- Collections Questions and Answers
- Exception Handling Questions and Answers
- Input Output Streams Questions and Answers
- Interfaces Questions & Answers
- java.io Package Questions & Answers
- java.lang Package Questions & Answers
- java.util Package Questions & Answers
- Packages Questions & Answers
- Serialization Questions & Answers
- Threads Questions & Answers
Data Types Questions & Answers
1. What is the range of data type short in Java?
Data Types Questions & Answers
2. What is the range of data type byte in Java?
Data Types Questions & Answers
3. An expression involving byte, int, and literal numbers is promoted to which of these?
Data Types Questions & Answers
4. Which of these literals can be contained in a data type float variable?
Data Types Questions & Answers
5. Which data type value is returned by all transcendental math functions?
Operators Questions & Answers
1. Which of the following can be operands of arithmetic operators?
Operators Questions & Answers
2. Modulus operator, %, can be applied to which of these?
Operators Questions & Answers
3. With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?
1. x++;
2. x = x + 1;
3. x += 1;
4. x =+ 1;
Operators Questions & Answers
4. Decrement operator, –, decreases value of variable by what number?
Operators Questions & Answers
5. Which of these statements are incorrect?
Applets Questions and Answers
1. Which of these functions is called to display the output of an applet?
Applets Questions and Answers
2. Which of these methods can be used to output a sting in an applet?
Applets Questions and Answers
3. What does AWT stands for?
Applets Questions and Answers
4. Which of these methods is a part of Abstract Window Toolkit (AWT) ?
Applets Questions and Answers
5. Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
Arrays Questions and Answers
1. Which of these operators is used to allocate memory to array variable in Java?
Arrays Questions and Answers
2. Which of these is an incorrect array declaration?
Arrays Questions and Answers
3. What will this code print?
int arr[] = new int [5];
System.out.print(arr);
Arrays Questions and Answers
4. Which of these is an incorrect Statement?
Arrays Questions and Answers
5. Which of these is necessary to specify at time of array initialization?
Collections Questions and Answers
1. Which of these packages contain all the collection classes?
Collections Questions and Answers
2. Which of these classes is not part of Java’s collection framework?
Collections Questions and Answers
3. Which of these interface is not a part of Java’s collection framework?
Collections Questions and Answers
4. Which of these methods deletes all the elements from invoking collection?
Collections Questions and Answers
5. What is Collection in Java?
Exception Handling Questions & Answers
1. When does Exceptions in Java arises in code sequence?
Exception Handling Questions & Answers
2. Which of these keywords is not a part of exception handling?
Exception Handling Questions & Answers
3. Which of these keywords must be used to monitor for exceptions?
Exception Handling Questions & Answers
4. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?
Exception Handling Questions & Answers
5. Which of these keywords is used to manually throw an exception?
Input Output Streams Questions and Answers
1. Which of these is used to perform all input & output operations in Java?
Input Output Streams Questions and Answers
2. What does AWT stands for?
Input Output Streams Questions and Answers
3. Which of these is a type of stream in Java?
Input Output Streams Questions and Answers
4. Which of these classes are used by Byte streams for input and output operation?
Input Output Streams Questions and Answers
5. Which of these classes are used by character streams for input and output operations?
Interfaces Questions & Answers
1. Which of these keywords is used to define interfaces in Java?
Interfaces Questions & Answers
2. Which of these can be used to fully abstract a class from its implementation?
Interfaces Questions & Answers
3. Which of these access specifiers can be used for an interface?
Interfaces Questions & Answers
4. Which of these keywords is used by a class to use an interface defined previously?
Interfaces Questions & Answers
5. Which of the following is correct way of implementing an interface salary by class manager?
java.io Package Questions & Answers
1. Which of these packages contain classes and interfaces used for input & output operations of a program?
java.io Package Questions & Answers
2. Which of these class is not a member class of java.io package?
java.io Package Questions & Answers
3. Which of these interface is not a member of java.io package?
java.io Package Questions & Answers
4. Which of these class is not related to input and output stream in terms of functioning?
java.io Package Questions & Answers
5. Which of these is specified by a File object?
java.lang Package Questions and Answers
1. Which of these classes is not included in java.lang?
java.lang Package Questions and Answers
2. Which of these is a process of converting a simple data type into a class?
java.lang Package Questions and Answers
3. Which of these is a super class of wrappers Double & Integer?
java.lang Package Questions and Answers
4. Which of these is wrapper for simple data type float?
java.lang Package Questions and Answers
5. Which of the following is method of wrapper Float for converting the value of an object into byte?
java.util Package Questions & Answers
1. Which of these standard collection classes implements a dynamic array?
java.util Package Questions & Answers
2. Which of these class can generate an array which can increase and decrease in size automatically?
java.util Package Questions & Answers
3. Which of these method can be used to increase the capacity of ArrayList object manually?
java.util Package Questions & Answers
4. Which of these method of ArrayList class is used to obtain present size of an object?
java.util Package Questions & Answers
5. Which of these methods can be used to obtain a static array from an ArrayList object?
Packages Questions and Answers
1. Which of these keywords is used to define packages in Java?
Packages Questions and Answers
2. Which of these is a mechanism for naming and visibility control of a class and its content?
Packages Questions and Answers
3. Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package?
Packages Questions and Answers
4. Which of these access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?
Packages Questions and Answers
5. Which of the following is correct way of importing an entire package ‘pkg’?
Serialization Questions and Answers
1. Which of these is a process of writing the state of an object to a byte stream?
Serialization Questions and Answers
2. Which of these process occur automatically by java run time system?
Serialization Questions and Answers
3. Which of these is an interface for control over serialization and deserialization?
Serialization Questions and Answers
4. Which of these interface extends DataOutput interface?
Serialization Questions and Answers
5. Which of these is a method of ObjectOutput interface used to finalize the output state so that any buffers are cleared?
Strings Questions and Answers
1. Which of these class is superclass of String and StringBuffer class?
Strings Questions and Answers
2. Which of these operators can be used to concatenate two or more String objects?
Strings Questions and Answers
3. Which of these method of class String is used to obtain length of String object?
Strings Questions and Answers
4. Which of these method of class String is used to extract a single character from a String object?
Strings Questions and Answers
5. Which of these constructors is used to create an empty String object?
Threads - Java Multiple Choice Questions and Answers
1. Which of these method can be used to make the main thread to be executed last among all the threads?
Threads - Java Multiple Choice Questions and Answers
2. Which of these method is used to find out that a thread is still running or not?
Threads - Java Multiple Choice Questions and Answers
3. What is the default value of priority variable MIN_PRIORITY AND MAX_PRIORITY?
Threads - Java Multiple Choice Questions and Answers
4. Which of these method waits for the thread to treminate?
Threads - Java Multiple Choice Questions and Answers
5. Which of these method is used to explicitly set the priority of a thread?