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

Important Questions Java

The document outlines important questions related to Object-Oriented Programming (OOP) with Java, covering various units. Topics include Java architecture, OOP concepts, exception handling, Java streams, collections framework, and Spring framework. Each unit contains specific questions designed to assess understanding of Java programming principles and practices.

Uploaded by

sp3008495
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

Important Questions Java

The document outlines important questions related to Object-Oriented Programming (OOP) with Java, covering various units. Topics include Java architecture, OOP concepts, exception handling, Java streams, collections framework, and Spring framework. Each unit contains specific questions designed to assess understanding of Java programming principles and practices.

Uploaded by

sp3008495
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

OOPs WITH JAVA

Important Questions

UNIT-1
1.​ Describe JVM and byte code in Java Architecture.

2.​ What is object oriented programming?


Explain different OOPs concepts class, objects, inheritance, abstraction, encapsulation,
polymorphism with suitable examples.

3.​ Write about java and its features.

4.​ Difference between (with examples):


a.​ Method overloading and overriding.
b.​ JVM, JDK, JRE
c.​ Class, object, method.
d.​ Encapsulation & polymorphism.
e.​ Runtime polymorphism & compile time polymorphism.

5.​ Explain abstraction and abstract classes in Java. Describe abstract method. With a
suitable example demonstrate the application of abstract classes.

6.​ Explain briefly about Control flow statements in java.

7.​ Define packages and how packages are created and accessed in java? Briefly explain
the naming convention of packages in java.

8.​ Write short notes on :


a.​ Types of operators
b.​ Data types
c.​ Variables
d.​ Array
e.​ String

9.​ Illustrate polymorphism and its types in Java. Differentiate between run-time and
compile-time polymorphism. Write super class Shape with method displayArea() and sub
class Rectangle.
Demonstrate method overriding with this example.

10.​Illustrate Constructors and their applications in Java. Describe the types of constructors
used in Java. Write a class with the name Student with attributes roll_number, name,
branch and email.
Write all argument constructor for class Student and create two objects with this
constructor.

UNIT-2
1.​ Describe all the keywords used for exception handling in Java.

2.​ What do you mean by exception in java? Difference between exception and error in java
with example.

3.​ Explain the concept of exception handling in Java. Why is it important?

4.​ Describe the use of try, catch, finally, throw, and throws with examples.

5.​ Difference between final, finally, finalize with example.

6.​ Differentiate between checked and unchecked exceptions in Java. Write a Java program
to demonstrate Arithmetic Exception handling.

7.​ Differentiate between with suitable examples:


1. Character streams and Byte Streams
2. wait() and notify()

8.​ Discuss the thread and its life cycle with examples.

9.​ Describe the ways to create the threads in Java with suitable code. Also explain which
method is more suitable to create threads.

10.​What is multi-threading in java. Explain the inter thread communication in java with
suitable examples.

UNIT-3
1.​ Explain Java stream API and its applications. Describe Intermediate and terminal
operations with suitable examples. Write a program to print sum of all even numbers
form an ArrayList<Integer> containing all integers from 1 to 10.

2.​ Compare and contrast switch-case statement with switch-expression in Java. Explain
with suitable examples.

3.​ Explain the functional interfaces in Java. Describe lambda expressions with the help of
functional interfaces.

4.​ Explain Interfaces in Java with suitable examples.

5.​ Discuss defaul method in java and its features with example. Discuss static method in
java and it's features with example.

6.​ What are method references in java and it's types

7.​ What is the forEach() method in Java? Explain with a suitable code.

8.​ Explain "type annotations" and "repeating annotations" with suitable examples.

9.​ Explain Base-64 encoding and decoding with a suitable code.

10.​Explain the following terms briefly with their usage-


a.​ Sealed Classes.
b.​ Text blocks
c.​ Records
d.​ Diamond syntax
e.​ Local variable type inference

UNIT-4
1.​ Describe Linked List in Java collection framework. With suitable example describe any
five methods available in Linked Lists.

2.​ What is map interface? Describe HashMap in Java collection framework. With suitable
examples describe any five methods available in HashMaps.
Compare hashmap, linked hash map, tree map and hash table.

3.​ Describe Collections framework in Java with a suitable diagram displaying interfaces and
classes and their hierarchy. Also explain the List, Set and Queue interfaces.
4.​ Write a Java program to create an ArrayList<String> with five items and display all the
elements using forEach method.

5.​ Differentiate between the Collection and Collections classes in Java.

6.​ How is Stack implemented using Java's Collection Framework? Write a program to
demonstrate basic push/pop operations.

7.​ Compare ArrayList, LinkedList, and Vector.

8.​ What is the difference between comparable and comarator interface with example.

9.​ Difference between hashset, linked hashset, tree set with example.

10.​ What are iterator and list iterator in java with examples.

UNIT-5
1.​ Describe following
a. Spring container
b. Spring bean life cycle

2.​ Describe following


a. Spring boot framework and its benefits
b. RESTFUL API with Spring boot

3.​ What is the spring framework? Explain the difference between Dependency Injection (DI)
and Inversion of Control (IoC) in Spring.

4.​ What do you understand by Restful web services in spring boot and how to build them?
What are its advantages?
Explain GET, PUT, POST and DELETE method with respect to RESTFUL API with
example.

5.​ Explain the concept of Sealed classes in Java with suitable example

6.​ What is Autowiring in Spring? Explain different autowiring modes


7.​ Define Aspect-Oriented Programming (AOP) in Spring. How is it useful in cross-cutting
concerns like logging and security?

8.​ How can @PostConstruct and @PreDestroy annotations be used to manage bean
lifecycle?

9.​ Discuss features of the spring. What are the different types of lifecycle callbacks in
spring?

10.​What are the roles of Spring boot runner and logger?

You might also like