0% found this document useful (0 votes)
23 views7 pages

Class 12 Viva Questions

The document provides an overview of key concepts related to Java, including the Java Virtual Machine (JVM), platform independence, and the differences between JDK and JVM. It also covers object-oriented programming principles such as inheritance, encapsulation, and polymorphism, along with threading concepts like synchronization and deadlock. Additionally, it explains Remote Method Invocation (RMI) and its architecture, as well as fundamental networking concepts like DNS and URL.

Uploaded by

Somesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views7 pages

Class 12 Viva Questions

The document provides an overview of key concepts related to Java, including the Java Virtual Machine (JVM), platform independence, and the differences between JDK and JVM. It also covers object-oriented programming principles such as inheritance, encapsulation, and polymorphism, along with threading concepts like synchronization and deadlock. Additionally, it explains Remote Method Invocation (RMI) and its architecture, as well as fundamental networking concepts like DNS and URL.

Uploaded by

Somesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

What is JVM?

The Java interpreter along with the run time


environment required to run the Java application
in called as Java virtual machine(JVM)

2. What is the most important feature of


Java?
Java is a platform independent language.

3. What do you mean by platform


independence?
Platform independence means that we can write
and compile the java code in one platform (eg
Windows) and can execute the class in any other
supported platform eg (Linux,Solaris,etc).

4. What is the difference between a JDK


and a JVM?
JDK is Java Development Kit which is for
development purpose and it includes execution
environment also. But JVM is purely a run time
environment and hence you will not be able to
compile your source files using a JVM.
5. What is the base class of all classes?
java.lang.Object

6. What are the access modifiers in Java?


There are 3 access modifiers. Public, protected
and private, and the default one if no identifier is
specified is called friendly, but programmer
cannot specify the friendly identifier explicitly.

7. What is are packages?


A package is a collection of related classes and
interfaces providing access protection and
namespace management.

8. What is meant by Inheritance and what


are its advantages?
Inheritance is the process of inheriting all the
features from a class. The advantages of
inheritance are reusability of code and
accessibility of variables and methods of the
super class by sub classes.
9.What is the difference between superclass
and subclass?
A super class is a class that is inherited whereas
sub class is a class that does the inheriting.

10. What is an abstract class?


An abstract class is a class designed with
implementation gaps for sub classes to fill in and
is deliberately incomplete.

11. What are the states associated in the


thread?
Thread contains ready, running, waiting and
dead states.

12. What is synchronization?


Synchronization is the mechanism that ensures
that only one thread is accessed the resources at
a time.

13. What is deadlock?


When two threads are waiting each other and
can’t precede the program is said to be deadlock.

14. What is an applet?


Applet is a dynamic and interactive program that
runs inside a web page displayed by a java
capable browser
15.What are Encapsulation, Inheritance and
Polymorphism?
Encapsulation is the mechanism that binds
together code and data it manipulates and keeps
both safe from outside interference and misuse.
Inheritance is the process by which one object
acquires the properties of another object.
Polymorphism is the feature that allows one
interface to be used for general class actions.

16.What is the use of bin and lib in JDK?


Bin contains all tools such as javac, appletviewer,
awt tool, etc., whereas lib contains API and all
packages.

17.What is method overloading and


method overriding?

Method overloading: When a method in a class


having the same method name with different
arguments is said to be method overloading.
Method overriding : When a method in a class
having the same method name with same
arguments is said to be method overriding.

18.What is the difference between this()


and super()?
this() can be used to invoke a constructor of the
same class whereas super() can be used to
invoke a super class constructor.

19.What is Domain Naming Service(DNS)?


It is very difficult to remember a set of
numbers(IP address) to connect to the Internet.
The Domain Naming Service(DNS) is used to
overcome this problem. It maps one particular IP
address to a string of characters. For example,
www. mascom. com implies com is the domain
name reserved for US commercial sites, moscom
is the name of the company and www is the
name of the specific computer, which is
mascom’s server.

20.What is URL?
URL stands for Uniform Resource Locator and it
points to resource files on the Internet. URL has
four components: http://www. address.
com:80/index.html, where http - protocol name,
address - IP address or host name, 80 - port
number and index.html - file path.

21.What is RMI and steps involved in


developing an RMI object?

Remote Method Invocation (RMI) allows java


object that executes on one machine and to
invoke the method of a Java object to execute on
another machine. The steps involved in
developing an RMI object are: a) Define the
interfaces b) Implementing these interfaces c)
Compile the interfaces and their implementations
with the java compiler d) Compile the server
implementation with RMI compiler e) Run the RMI
registry f) Run the application.

22. What is RMI architecture?


RMI architecture consists of four layers and each
layer performs specific functions: a) Application
layer - contains the actual object definition. b)
Proxy layer - consists of stub and skeleton. c)
Remote Reference layer - gets the stream of
bytes from the transport layer and sends it to the
proxy layer. d) Transportation layer - responsible
for handling the actual machine-to-machine
communication.

You might also like