0% found this document useful (0 votes)
3 views

JAVA Viva Prep

The document outlines key concepts of Object-Oriented Programming (OOP) including definitions of objects, classes, inheritance, polymorphism, and encapsulation. It also covers practical aspects such as using ArrayLists, handling exceptions, and working with SWING for user interfaces, as well as file I/O operations in Java. Each slide presents a series of questions aimed at exploring these topics in depth.

Uploaded by

Saurov Sarker
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

JAVA Viva Prep

The document outlines key concepts of Object-Oriented Programming (OOP) including definitions of objects, classes, inheritance, polymorphism, and encapsulation. It also covers practical aspects such as using ArrayLists, handling exceptions, and working with SWING for user interfaces, as well as file I/O operations in Java. Each slide presents a series of questions aimed at exploring these topics in depth.

Uploaded by

Saurov Sarker
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SLIDE 1 – INTRODUCTION

1. What is object oriented programming? How is this different from procedural programing?
2. What is an object in OOP?
3. What are the properties of an object? Give an example.
4. What is a class? What are the differences between a class and an object?
5. What is abstraction in OOP?
6. What is encapsulation? How do we encapsulate an attribute in java? Can we encapsulate a
method?
7. How many data types are there in Java?
8. What is instantiation? How to create an instance of an object in Java?
SLIDE 2 – USING OBJECTS

1. What is an object reference? Give an example. What is the difference between object
reference and instance?
2. How do we invoke a method in OOP?
3. What happens when you assign a variable to another variable in JAVA?
4. What are aliases? Provide an example.
5. What is the garbage collector in JAVA? How does it help?
6. What is a library? Give some examples. How to import a library in JAVA? What library is
imported by default in JAVA?
7. What is a package?
8. Describe the 'Random' class in java. For what we can use it? Give an example.
9. What is the 'Scanner' class?
10. Describe the 'Math' class.
11. How can we take user input in JAVA?
12. How to output something in JAVA?
SLIDE 3 – Writing Classes

1. What is a constructor? How many constructors can a class have? What happens if there is
no constructor in a class? Will there be an error when the code is executed?
2. What are the accessors and mutators?
3. What is the toString method?
4. What is an UML diagram?
5. How many visibility modifiers are there in JAVA? What are they?
SLIDE 4 – Object Oriented Design

1. What are steps involved in the creation of a software? Describe each steps.
2. What is a static method? What is a static variable?
3. How many class relationship exists? Describe each of them with an example.
4. How to use an object as a method parameter?
SLIDE 5 – ArrayList

1. What is an ArrayList? What are the differences between Array and ArrayList? Which is
better and why?
2. Which library in JAVA contains the ArrayList class?
3. How to declare an ArrayList?
4. ArrayList<int> list. Is this valid? If not, why?
5. If we write, new ArrayList<>(10), what does this 10 indicates?
6. How to add something into an ArrayList? How to insert in between?
7. How to get the data from ith index?
8. How to find how many items are there in an ArrayList?
9. How to change the value of 4th index of an ArrayList to 27?
10. How to delete an element from an ArrayList?
11. How to remove all elements from an ArrayList at once?
12. How to search for an item in an ArrayList?
13. How to get the index of an element in an ArrayList? What will happen if the value isn’t
present in the ArrayList?
14. How to check if an ArrayList has any element or not?
15. How does a for-each loop works? Is it better than a for loop?
16. How can we copy an ArrayList?
SLIDE 6 – Inheritance

1. What is inheritance in OOP?


2. What is a parent class and what is a child class? How are they related? Give an example.
3. How can a class inherit another class?
4. What is the "this" reference?
5. What is the "super" reference?
6. How to call the method of a parent class?
7. How to create a parent object through a child constructor?
8. Is multiple inheritance possible in JAVA? Why/why not?
9. How can we achieve multiple inheritance in JAVA?
10. What is the method overriding?
11. What is the method overriding?
12. What does the Equals method do?
SLIDE 7 – Polymorphism

1. What is polymorphism?

2. What are the differences between polymorphism and inheritance?


SLIDE 8 – Abstract Classes and Interfaces

1. What is an abstract class? Can an abstract class be instantiated?

2. Why cannot an abstract class be declared as final or static?

3. What is an interface?

4. How to implement an interface?

5. What are the differences between an abstract class and an interface?

6. Can an interface be instantiated?

7. Does JAVA support multiple interface instantiation?

8. Name any interface that is already built-in JAVA. What does this interface do?
SLIDE 9 - Exceptions

1. What is an exception?

2. In how many flows, a program can be executed?

3. How does a program handle an exception?

4. Explain the try - catch - finally blocks.

5. Differentiate between throw and throws.


SLIDE 10 – SWING

1. What is SWING?
2. What is components/widgets in SWING?
3. Name some types of layouts in SWING.
4. Which SWING component we use to take user input?
5. How can we upload a file in SWING?
6. What is an event?
7. How can we handle an event in SWING?
SLIDE 11 – Streams and File I/O

1. What are the advantages of file I/O?


2. What is a stream? How many types of streams are there?
3. Differentiate between binary file and text file.
4. What is appending to a file? How to do that?
5. Why should we close a file?
6. How to read a file?
7. How to write to a file?
8. Why do we need exception handling while doing file operations?

You might also like