Viva Questions For Java Lab
Viva Questions For Java Lab
Viva Questions For Java Lab
by
Basics
What is Java?
Java is an object oriented programming language
What is JVM?
Java Virtual Machine which accepts java byte code and produces result
Object-Orientation Section
What is class?
Class is blue print for objects; Class is collection of objects; Class gives the general
structure for objects.
What is object?
Object is an instance of class. Object is real world entity which has state, identity and
behavior.
What is encapsulation?
Encapsulation is packing of data with their methods
What is abstraction?
Abstraction is the process of identification of essential features of objects
What is hierarchy?
Ordering of classes (or inheritance)
What is inheritance?
Extending an existing class is called inheritance. Extracting the features of super class
What is interface?
Interface is collection of final variables and abstract methods
(We need not give final and abstract keywords and By default they are public methods)
What is polymorphism?
Multiple (poly) forms (morphs)
Same instance can respond different manners is called polymorphism
What is overloading?
Same method name can be used with different type and number of arguments (in same
class)
What is overriding?
Same method name, similar arguments and same number of arguments can be
defined in super class and sub class. Sub class methods override the super class methods.
Keywords section
What is keyword?
Java reserved word which should is not used as variable/class-name (e.g.: break, for, if,
while etc)
What is this( )?
Used for calling another constructor of current class
What is package?
Package is collection of classes and interfaces
What is CLASSPATH?
It is an environment variable which is used for defining the location of class files
What is jar?
Jar stands for Java archive files, compressed set of class files and can be used in
CLASSPATH
What is the meaning of import java.awt.*;?
Import all the classes and interfaces in the java.awt.package. This doesn't imports other
packages
defined in java.awt. package.
What is exception?
Abnormal termination of program is called exception
Multithreading Section
What is thread?
Thread is a part of process, also called as light weight process
What is multithreading?
Simultaneous execution of threads is called multithreading
What is a process?
Program under execution is called process
What is an applet?
Applet is a java program which runs via java-enabled browser
What is an event?
A kind of action
C++