Question 1: JAVA - Variable Declaration Basics
Which of the following is a valid variable declaration in Java?
Question 2: JAVA - Method Basics
Which of the following is a valid method declaration in Java?
Question 3: JAVA - String Immutability
Why are Strings immutable in Java?
Question 4: JAVA - Array Declaration
Which of the following is a valid array declaration in Java?
Question 5: JAVA - Exception Types
Which of the following is a checked exception in Java?
Question 6: JAVA - Collection Interface
Which of the following is the root interface of the Java Collections Framework?
Question 7: JAVA - Generics Basics
What is the main purpose of Generics in Java?
Question 8: JAVA - Lambda Basics
What is the main purpose of lambda expressions in Java?
Question 9: JAVA - Streams Basics
What is the main advantage of using Streams in Java?
Question 10: JAVA - Thread Creation
Which of the following is a correct way to create a thread in Java?
Question 11: JAVA - Data Types
Which of the following is a primitive data type in Java?
Question 12: JAVA - Return Type
What will be the output?
Question 13: JAVA - String Object Creation
Which of the following creates a new String object in the heap?
Question 14: JAVA - Array Initialization
What will be the default values of an int array in Java?
Question 15: JAVA - Try-Catch Execution
What will be the output?
Question 16: JAVA - List Characteristics
Which statement about `List` is correct?
Question 17: JAVA - Generic Class
Which of the following correctly defines a generic class?
Question 18: JAVA - Lambda Syntax
Which is the correct syntax for a lambda expression that takes two integers a and b and returns their sum?
Question 19: JAVA - Stream Creation
Which of the following is a correct way to create a stream from a list?
Question 20: JAVA - Start vs Run
What happens if you call the run() method directly instead of start() on a thread?