0% found this document useful (0 votes)
3 views5 pages

Java Important Questions

The document outlines a comprehensive curriculum for learning Java, covering topics such as OOP fundamentals, exception handling, Java's new features, collections framework, and Spring & Spring Boot. It includes various difficulty-level questions to assess understanding and application of concepts, ranging from JVM architecture to RESTful web services. Each unit focuses on essential Java programming principles and practices, providing a structured approach to mastering the language.

Uploaded by

kashyapmonti460
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)
3 views5 pages

Java Important Questions

The document outlines a comprehensive curriculum for learning Java, covering topics such as OOP fundamentals, exception handling, Java's new features, collections framework, and Spring & Spring Boot. It includes various difficulty-level questions to assess understanding and application of concepts, ranging from JVM architecture to RESTful web services. Each unit focuses on essential Java programming principles and practices, providing a structured approach to mastering the language.

Uploaded by

kashyapmonti460
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

Unit I: Introduction & OOP Fundamentals

Focus: JVM architecture, language basics, and core Object-Oriented principles.

# Difficulty Question Statement Marks

1 Easy Describe JVM and byte code in Java Architecture. 2

2 Easy Why is Java considered platform-independent? 2

3 Easy Define the role of a constructor in a Java class. 2

4 Easy Differentiate between static and final members. 2

5 Moderate Explain the significance of the CLASSPATH setting. 2

Explain abstraction and abstract classes with a suitable code


6 Moderate 7
example.

Illustrate polymorphism and differentiate between run-time


7 Moderate 7
and compile-time polymorphism.

Write a Java class Student with attributes (ID, Name) and an


8 Moderate 7
all-argument constructor.

Compare method overloading and method overriding with


9 Moderate 7
examples.

Describe the relationship between classes and objects using


10 Challenging 10
a real-world example.

Explain why multiple inheritance is not possible in Java and


11 Challenging 10
how interfaces solve this.

Discuss the structure of a Java Source File and the


12 Moderate 7
compilation process.

13 Easy What are the different access specifiers in Java? 2

14 Moderate Explain the concept of Encapsulation and its benefits. 7

Create a program to demonstrate Interface implementation


15 Challenging 7
with multiple classes.

16 Easy What is the purpose of the super keyword? 2


# Difficulty Question Statement Marks

Describe the differences between Abstract Classes and


17 Moderate 7
Interfaces.

18 Easy Define Packages and their naming conventions. 2

19 Moderate Write a program to reverse a string provided by the user. 7

20 Moderate Explain the use of Static Import in Java packages. 2

Unit II: Exception Handling, I/O, & Multithreading

Focus: Robustness via error handling, file operations, and concurrent execution.

# Difficulty Question Statement Marks

1 Easy Describe the keywords: try, catch, finally, throw, and throws. 2

2 Easy Differentiate between Checked and Unchecked exceptions. 7

3 Easy What is the purpose of the finally block? 2

4 Easy Define Thread Priorities. 2

5 Moderate Describe the various states of a thread in its life cycle. 7

Illustrate the concept of multi-threading with a code


6 Moderate 7
implementing two threads.

7 Moderate Compare Byte Streams and Character Streams in Java I/O. 7

8 Moderate Discuss Thread Synchronization and why it is required. 10

Write code to create three threads (Red, Blue, Green) and


9 Challenging 10
justify using run() vs start().

10 Moderate Explain Inter-thread Communication using wait() and notify(). 7

11 Moderate How do you create a User-Defined Exception? 2

12 Moderate Write a program to handle an ArithmeticException. 7

13 Easy Differentiate between Exceptions and Errors. 2


# Difficulty Question Statement Marks

14 Moderate Describe the JVM's reaction to an unhandled exception. 7

Write a program to read and write to a file using


15 Moderate 7
FileInputStream.

16 Easy What is the Runnable interface? 2

17 Moderate Discuss the control flow in a nested try-catch block. 7

18 Easy What is Deadlock in multithreading? 2

Demonstrate a program handling multiple exceptions using


19 Challenging 7
try-catch-finally.

20 Moderate Explain the use of the volatile keyword in threads. 2

Unit III: Java New Features

Focus: Functional programming (Lambdas, Streams) and modern syntax updates.

# Difficulty Question Statement Marks

1 Easy What is a Functional Interface? Give an example. 2

2 Moderate Explain Lambda Expressions and their syntax. 7

3 Moderate Describe Java Stream API and its terminal operations. 7

4 Easy Define the Diamond Syntax with an example. 2

5 Moderate Explain Sealed Classes with a suitable example. 7

Write a program using forEach to display elements of an


6 Moderate 7
ArrayList.

7 Moderate Compare switch-case statements with switch-expressions. 7

8 Moderate Describe the Try-with-resources feature. 2

9 Moderate Explain Method References and their types. 7


# Difficulty Question Statement Marks

Use Stream API to print the sum of all even numbers from 1 to
10 Challenging 7
10.

11 Easy What are Type Annotations and Repeating Annotations? 2

12 Moderate Describe Records in Java and their benefits. 7

13 Easy Explain the Yield keyword in switch expressions. 2

14 Moderate Discuss the Java Module System (Project Jigsaw). 7

15 Easy What are Text Blocks in Java? 2

16 Moderate Explain Default and Static methods in interfaces. 7

17 Easy What is Local Variable Type Inference (var)? 2

18 Moderate Describe Base64 Encode and Decode utilities. 2

19 Easy Define Inner Anonymous Classes. 2

20 Moderate Implement a functional interface using a Lambda expression. 7

Unit IV: Java Collections Framework

Focus: Data structures and sorting interfaces.

# Difficulty Question Statement Marks

1 Moderate Describe the Collections framework hierarchy with a diagram. 10

2 Moderate Compare and contrast ArrayList and LinkedList. 7

3 Easy Differentiate between List, Set, and Map. 7

4 Easy How does Stack differ from Queue? 2

5 Moderate Explain HashMap and describe five methods available in it. 7

Write a program to iterate through keys and values of a


6 Moderate 7
HashMap.
# Difficulty Question Statement Marks

7 Moderate Differentiate between Comparable and Comparator interfaces. 7

8 Moderate What is the purpose of the Properties class? 2

Create an ArrayList<String> with five items and display using a


9 Moderate 7
loop.

10 Moderate Discuss TreeSet and how it maintains sorting. 7

Unit V: Spring & Spring Boot

Focus: Modern enterprise development via Dependency Injection and REST APIs.

# Difficulty Question Statement Marks

Explain the difference between Dependency Injection (DI)


1 Moderate 7
and Inversion of Control (IoC).

2 Easy What is Spring Boot and its benefits over traditional Spring? 7

3 Moderate Describe the Spring Bean Life Cycle. 7

4 Moderate Discuss Spring Bean Scopes (Singleton, Prototype, etc.). 7

5 Easy What is Aspect-Oriented Programming (AOP)? 2

6 Moderate Describe the structure of a basic Spring Boot application. 7

7 Easy Differentiate between GET and POST requests in REST. 2

8 Challenging Explain how to build a RESTful Web Service using Spring Boot. 10

Describe @RestController, @RequestMapping, and


9 Moderate 7
@RequestBody annotations.

Develop a simple API in Spring Boot to perform CRUD


10 Challenging 10
operations.

You might also like