JAVA FAQ Viva Questions With Answers
JAVA FAQ Viva Questions With Answers
Q) What is an Object?
A)Object is an instance of a class. It has state,behavior and identity. It is also
called as an instance of a class.
Q) What is Java?
Java is a high-level programming language originally developed by Sun Microsystems and
released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the
various versions of UNIX.
Prepared by PSC 1
Course Name: OOPJ Lab Course Code: CSL304 FAQ
(eg Windows) and can execute the class in any other supported platform eg
(Linux,Solaris,etc).
Q) What is synchronization?
A) Synchronization is the mechanism that ensures that only one thread is accessing the resources
at a time.
Q) What is deadlock?
Prepared by PSC 2
Course Name: OOPJ Lab Course Code: CSL304 FAQ
A) When two threads are waiting each other and can’t precede the program is said to be deadlock
Q) What is an applet?
A) Applet is a dynamic and interactive program that runs inside a web page displayed by a java
capable browser
Q) What is a layout manager and what are different types of layout managers available in java
AWT?
A) layout manager is an object that is used to organize components in a container. The different
layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout and
GridBagLayout
Q) What is JDBC?
A) JDBC is a set of Java API for executing SQL statements. This API consists of a set of classes
and interfaces to enable programs to write pure Java Database applications.
Prepared by PSC 3
Course Name: OOPJ Lab Course Code: CSL304 FAQ
Q) Why Java?
A) The programs that we are writing are very similar to their counterparts in several other
languages, so our choice of language is not crucial. We use Java because it is widely available,
embraces a full set of modern abstractions, and has a variety of automatic checks for mistakes in
programs, so it is suitable for learning to program. There is no perfect language, and you
certainly will be programming in other languages in the future
Q) What happens when you omit a brace or misspell one of the words, like public or static or
main?
A) It depends upon precisely what you do. Such errors are called syntax errors. Try it out and
see.
Prepared by PSC 4
Course Name: OOPJ Lab Course Code: CSL304 FAQ
A) Yes, you can put several, though we normally use only a few. You refer to the second one as
args[1], the third one as args[2], and so forth. Note that we start counting from 0 in Java.
Q) What Java systems libraries and methods are available for me to use?
A) There are thousands of them, but we introduce them to you in a deliberate fashion in this
book to avoid overwhelming you with choices
Q) What is the difference between object oriented programming language and object based
programming language?
A) Object based programming languages follow all the features of OOPs except Inheritance.
JavaScript is an example of object based programming languages
Prepared by PSC 5
Course Name: OOPJ Lab Course Code: CSL304 FAQ
Q) What is NullPointerException?
A) NullPointerException is thrown when calling the instance method of a null object, accessing
or modifying the field of a null object etc.
Q) Does it matter in what order catch statements for FileNotFoundException and IOException
are
written?
A) Yes, it does. The FileNoFoundException is inherited from the IOException. Exception’s
subclasses have to be caught first.
Q) What is an Interface?
A) An interface is a collection of abstract methods. A class implements an interface, thereby
inheriting the abstract methods of the interface.
Prepared by PSC 6
Course Name: OOPJ Lab Course Code: CSL304 FAQ
Q) What is an applet?
A) An applet is a Java program that runs in a Web browser. An applet can be a fully functional
Java application because it has the entire Java API at its disposal.
A) Inheritance is the term used in Java to describe the process of building a new class utilizing
the features of an existing class. In other words, inheritance is how a child class acquires each
parent class's traits.
Prepared by PSC 7
Course Name: OOPJ Lab Course Code: CSL304 FAQ
A) Superclasses are classes from which features are inherited by subclasses. It is also known as
the parent class or foundation class.
Subclasses are classes that contain all the properties, methods, and nested classes of another
class. A derived class, kid class, or extended class are other names.
Prepared by PSC 8