Object-Oriented Programming

Object-Oriented Programming

Object-Oriented Programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior.

Nested class - A class can be made static only if it is _______________?

TRUE - A class can have multiple Static blocks, which will execute in the same sequence inwhich they have been written into the program.

TRUE - A class derived from the abstract class must implement all those methods that aredeclared as abstract in the parent class.

Abstract class- A class that is declared using abstract keyword.

Concrete class- A class which is not abstract is referred as.

FALSE - A constructor can be declared as final.

FALSE -A final class can be inherited.

TRU -A final method cannot be overridden.

Blank final variable- A final variable that is not initialized at the time of declaration is known as


FALSE- A finally block must be associated without a try block.

Java- A popular general-purpose programming language and computing platform. It isfast, reliable, and secure.

TRUE- A set of processes or threads is said to be deadlocked when each is waiting for anaction that only one of the others can perform.

FALSE- A try-finally block is not possible without catch block.

TRUE- Abstract method has no body.

TRUE- All variables declared in an interface are by default final.

JDK- Allows developers to create Java programs that can be executed and run by the JVM and JRE.

FALSE- An abstract class can be instantiated.

TRUE- An abstract class has no use until unless it is extended by some other class.

TRUE- An abstract class must be extended and in a same way abstract method must be overridden.

TRUE - An exception in the finally block, behaves exactly like any other exception.

FALSE- An interface can implement another interface

Protected- Attributes and methods with the access modifier protected can be accessed within your class, by all classes within the same package, and by all subclasses within the same or other packages.

FALSE- Class that implements any interface must implement all the methods of that interface, else the class should be declared abstract.

Container classes- Classes that can have other components on it.

TRUE- Extending an interface can implement another interface.

The correct answer is: Facility to allow multiple activities within a single process.

Simple- Feature of java that is very easy to learn, and its syntax is simple, clean and easy to understand.

Object-Oriented- Feature of java that means, organizing our software as a combination of different types of objects that incorporates both data and behavior.

FALSE- finalize is used in .

FALSE- Finally is a method that is called by JVM during garbage collection.

Interface- Have methods and variables just like the class but the methods declared in it are bydefault abstract.

TRUE- If a child does not implement all the abstract methods of abstract parent class, then the child class must need to be declared abstract as well.

TRUE- If an exception occurs in try block then the control of execution is passed to the corresponding catch block.

TRUE- If method parameters are declared final then the value of these parameters cannot be changed.

TRUE - If no exception occurs in try block then the catch blocks are completely ignored.

FALSE- If you declare an abstract method in a class then you don't need to declare the class abstract as well.

TRUE- If you just want to achieve basic functionality of a thread you can simply implement Runnable interface and override run() method.

TRUE- Interface provides full abstraction as none of its methods have body.

Nested interface- Interface which is declared inside another interface or class.

Java library- is built on top of the Java Abstract Widget Toolkit (AWT), an older, platform dependent GUI toolkit.

The correct answer is: It belong to the class instead of a specific instance, this means you can access itwithout object.

Static methods- It can access class variables(static variables) without using object(instance) of the class.

Dialog- It can be thought of like a pop-up window that pops out when a message has to be displayed. It is not a fully functioning window like the Frame.

Bytecode Verifier- It checks the code fragments for illegal code that can violate access right to objects.

Finally block- It contains all the crucial statements that must be executed whether exception occurs or not.

Try block- It contains set of statements where an exception can occur.

Security Manager- It determines what resources a class can access such as reading and writing to the local disk.

Portable- It facilitates you to carry the Java bytecode to any platform.

Class variables- It has the static keyword as a prefix in its declaration. Its definition occurs only inside a class and outside any function.

Class- It is a blueprint for objects to follow a specific schema defined in the class.

Frame- It is a fully functioning window with its title and icons.

TRUE- It is a good practice to name final variable in all CAPS.

JVM- It is a Java platform component that executes programs.

Java swing- It is a lightweight Graphical User Interface (GUI) toolkit that includes a rich set of widgets. It includes package lets you make GUI components for your Java applications, and It is platform independent.

Panel- It is a pure container and is not a window in itself. The sole purpose of a it is to organize the components on to a window.

Static variable- It is common to all the instances (or objects) of the class because it is a class level variable.

Java FlowLayout- It is the default layout manager for every JPanel. It simply lays out components in a single row one after the other.

Java GridBagLayout- It is the more sophisticated of all layouts. It aligns components by placing them within a grid of cells, allowing components to span more than one cell.

Object- It is the most fundamental entity in Java or any other Object Oriented Language.

JRE- It is the on-disk part of Java that creates the JVM.

Static Block- It is used for initializing the static variables.

Catch block- It is where you handle the exceptions, this block must follow the try block.

TRUE- Its a good practice to use close() inside finally block.

Object-Oriented- Java is a write once, runObject Oriented Programming anywhere language.

James Gosling- Java is an Object-Oriented programming language developed by ______________ in the early 1990s

TRUE- Local final variable must be initializing during declaration.

TRUE- Making a member static can access it without object.

Inner interface- Nested interface are also known as?

Polymorphism- One of the OOPs feature that allows us to perform a single action in different ways.

Classloader- Part of the Java Runtime Environment(JRE) which is used to load Java classes into the Java Virtual Machine dynamically.

Java BorderLayout- Places components in up to five areas: top, bottom, left, right, and center. It is the default layout manager for every java JFrame.

Risk factor- Proper co-ordination is required between threads accessing common variables. 

close()- Statement used to close all the open streams in a program.

Class variables- Static variables are also known as ______________________?

Constructor- Sub class is invoked when we create the object of subclass, it by default invokes the default constructor of super class.

Polymorphism- The capability of a method to do different things based on the object that it is acting upon. In other words, it allows you define one interface and have multiple implementations.

B and C- The class that extends the features of another class is known as _____________?

TRUE- The class that implements interface must implement all the methods of that interface.

Parent Class- The class whose properties and functionalities are use (inherited) by another class is known as _______________?

Allows you to define one interface- The following are the advantages of Inheritance except.

December 1998- The J2SE 1.2 was released on

May 2000- The J2SE 1.3 was released on

February 2002- The J2SE 1.4 was released on

September 2004- The J2SE 5.0 was released on

March 2019- The JAVA SE 12 was released on

January 1996- The JDK 1.0 was released on

February 1997- The JDK 1.1 was released on

Expresso Bean- The name Java originates from a sort of ____________

Inheritance- The process by which one class acquires the properties (data members) and functionalities(methods) of another class.

Method Overriding- The same method in child class which is already present in the parent class.

Super Class- The super keyword refers to the ______________, immediately above of the calling class in the hierarchy.

Super Keyword- The superclass constructor can be called explicitly using the ____________________?

TRUE- The thread ends when it comes when the run() method finishes its execution.

TRUE- The variables declared in an interface are public, static & final by default.

Local variables- These are variables which have declarations inside methods, constructors or blocks.

Instance variables- These variables are inside a class however outside any method. They come into existence when the class instantiates.

Public- This is the least restrictive access modifier. Methods and attributes that use the public modifier can be accessed within your current class and by all other classes.

Private- This is the most restrictive and most commonly used access modifier. If you use the this modifier with an attribute or method, it can only be accessed within the same class.

Access Modifier- Use to define the visibility of classes, methods, and attributes.

Java Layout Manager- Used to layout the GUI java components inside a container.

TRUE- Using threads increases the responsiveness of GUI applications.

Final variable- Variables that is constants. This variable cannot be change once it is initialized.

FALSE- We can change the value of a final variable.

FALSE- We can instantiate an interface in java.

TRUE- We use thread to perform asynchronous or background processing

FALSE- When a thread is invoked, there will be one path of execution.

TRUE- Whenever there is multiple processes contending for exclusive access to multiple locks, there is the possibility of deadlock.

TRUE- You can not have abstract method in a concrete class.