Java Viva Questions: 1) OOP Principles
Java Viva Questions: 1) OOP Principles
7 Data abstraction(representing essential features without including the background details. Classes
uses the concept of abastraction
10. Abstract class(We can indicate hat a method must always be redefined in a subclass. This is
possible by using abstract keyword for the class)
1)OOP principles
2)datatypes in java
6)types of constructors
It is possible to create methods that have the same name but different parameter lists and different
definitions
8)define exception
It is an error
MException(String msg)
Super(msg);
System.out.println(msg);
ArithmeticException,ArrayIndexOutOfBoundsException,ArrayStoreException,FileNotFoundExcpetion,
IOException,NullPointerException,NumberFormatException,OutOfMemoryException,SecurityExcpetion,
StringIndexOutOfBoundsException,StackOverFlowExcpetion
start(),stop(),yield(),destroy(),wait(),sleep(),suspend(),resume(),notify(),notifyall()
17)define synchronization
At a particular instant of time access to the resource is allowed for only one client and the other clients
will be in the queue waiting for its turn to share the resource.
1)define inheritance
A subclass is created from an existing class,the existing class is called superclass and the new class
created is called the subclass
2)types of inheritance
When a new class is created from two or more existing classes it is called multiple inheritance ,it cannot
be implemented in java directly
4)how multiple inheritance is supported in java
5)define interface
It resembles like that of a class and contains final variable and abstract method
A variable whose value remains constant throughout the program is called a final variable
The methods which are not defined are called abstract methods, they are defined in the subclass where
interfaces are included
9)method overriding
When a method in the subclass contains the same return type,name and parameter list as that of the
method in the superclass then the method is executed instead of the method in superclass,this is called
methodover riding
12)define package
13)types of packages
public class A
2)what is string tokenizer :[This class is used to parse the input string and finds the delimiters]
5)list down the Source Events and their respective source listeners and abstract methods
6)define an applet
It is a java program that helps us to create dynamic and attractive web pages
7)What is the life cycle of an applet