ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Java-Related >> Java-J2EE >> Core-Java
 
 


 

Back to Questions Page
 
Question
What is method Overriding in the perspective of OOPS?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
method overriding is changing the exsiting functionality in
the subclass from the super class
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
Redefining the superclass method in the subclass. Means
redefining the implementation of superclass method in the
subclass
 
0
Boss
 
 
Question
What is method Overloading in the perspective of OOPS?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Two or more methods in the same class having same method 
name with different parameters may or may not have same 
return type is called method overloading
 
0
Aruna
 
 
 
Answer
mathods having same name but different signature in same 
class known as method overloading
 
0
Anand
 
 
Answer
In same class more than two methods having same name but 
different signatures are called method 
overloading .signatures are 
no of parameters,datatypes of parameters,sequence of 
parameters.returntype may same or not.

ex:public int add(int a,int b)
{
S.o.p(a+b);
}
public int add(int a,int b,intc)
{
S.o.p(a+b+c);
}
public double add(double d,double e)
{
S.o.p(d+e);
}
 
0
Kabita
 
 
Answer
Two or more methods having same name but different
signatures in the same class or in super class, sub
class(inheritance) then, that method is said to be
overloaded method.
This process is known as method overloading.

Note: Signature of a method means
1) no. of parameters
2) type of the parameter
3) order of the parameters

And a method cant be said as overloaded method only with the
change of the return type alone.

For example,
1) //for no of parameters

void display(int a,int b,int c)
{
 System.out.println("This is 3 arguments method");
}

void display(int a,int b)
{
 System.out.println("This is 2 arguments method");
}

2) //for type of parameters

void display(int a,int b)
{
 System.out.println("This is 2 int arguments method");
}

void display(float a,float b)
{
 System.out.println("This is 2 float arguments method");
}

3) //for order of parameters

void display(int a,float b)
{
 System.out.println("This is int,float argument method");
}

void display(float a,int b)
{
 System.out.println("This is float,int argument method");
}

Note: // cant determine only with return type

void display(int a,int b)
{
 System.out.println("This is 2 arguments method without
return type");
}

int display(int a,int b)// compile error here
{
 System.out.println("This is 2 arguments method with return
type");
}
 
0
Amarnath88888
 
 
Question
Explain about vector, dictionary,hash table, property 
classes?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   Patni
I also faced this Question!!   © ALL Interview .com
Answer
vector is a legacy class which contains all static methods
dictionary is a sub class of hastable and is used to store
the  objects as key-value pairs
hashtable is used to store the objects as key value pairs
and is a legacy class and doenn't allow null keys and null
vlaues
property is subclass of hashtable used to save the objects
 
0
Ravikiran(aptech Mumbai)
 
 
Question
What is static variable and static method?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   TCS , TCS
I also faced this Question!!   © ALL Interview .com
Answer
static variables are classes variables not instance 
variables .They are instantianted only once for a 
class.They are initialised at class load time.
Static method can be referenced with the name of the name 
of the particular object of that class. That's how the 
library methods like System.out.println works.
 
1
Niranjanravi
 
 
Answer
static variables are classes variables not instance 
variables .They are instantianted only once for a 
class.They are initialised at class load time.
Static method can be referenced with the name of the name 
of the particular object of that class. That's how the 
library methods like System.out.println works.
 
1
Venkat
 
 
Answer
A static variable is a variable who's single copy in memory
is shared by all objects,so any modifications to the static
variable will modify it's value in all objects.

Static variables are created in Method Area part of Memory.
 
0
Mallesh
 
 
Answer
static variable is a class variable which value remains
constant for the entire class
static method is the one which can be called with the class
itself and can hold only the staic variables
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
static variable is a class variable. This life time scope 
in whole prgm...

static method is use to access without creating object in 
the java prgm...
 
0
Naraen
 
 
Answer
A static variable ,also reffered to as a class variable 
which exists across instances of a class.
   By default,all variables are created as instance 
variables(A variable related to a single instance of a 
class.Each time an instance of a class is created,the 
system creates one copy of the instance variables related 
to that class).To make a class variable,you must explicitly 
declare the variable static.
 
0
Bijeesh.p
 
 
Answer
static variables are classes variables not instance 
variables .They are hold the value and instantianted only 
once for a 
class.They are initialised at class load time.
Static method can be referenced with the name of the name 
of the particular object of that class. That's how the 
library methods like System.out.println works.
 
0
Anupam Sharma
 
 
Answer
a variable declared inside a method is local to that method.
it can't be accessed outside the method. if a variable
declared in a class means its a global variable.if we
declare a variable with static keyword in a class means it
can be accessed by all the class.
 
0
Aravind
 
 
Question
What is meant by serialisation and deserialisation?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Serialisation is the process of taking up an object and 
converting it to a format which it can be transported 
across a network or persisted to a storage location.The 
storage location is as simple as using a file or a 
database.the serialised file format contains the object's 
state information.De-Serialisation is the process of re-
constructing the object from serialised state back to it's 
original state.
 
2
Niranjanravi
 
 
Answer
serialization is a process of saving the object into an
outputstream
deserializaton is a process of retrieving the object from
the outputstream
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
Serialization : means storing the object into persistenece 
storage like seconday memory ,files.

Deserialization : means restoring the persistent object.
 
0
Vijayakumar Chinnasamy
 
 
Question
Explain the concept of polymorphism with examples?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Polymorphism means If one thing exists in different forms v 
can it as pOlymorphism
EX:Overloading
Overriding
 
0
Venkat
 
 
Answer
polymorphism helps us create classes which are simple and
user friendly.it allow the class to behave polymorphicly
when different inputs are passed on to it.
 
0
Sankar
 
 
Answer
polymorphism is utilizing the same interface for multiple
purposes
ex:-overloading,overriding
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
polymorphisum-polymorphisum means one name many
forms,basically polymorphisum is base class pointer which
can access derive class members

real time example:-
on street signal if red signal turn on all type of vehicals
are stops means on single action multiple tasks are done.


compile time polymorphisum-overloading.

run time polymorphisum-overriding.
 
0
Dhawal
 
 
Question
What is meant by packages?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Packages are a way of grouping classes with related
functionality there by possible avoiding class name
collision and making it easier for the class library to be used.
 
2
Ranganathkini
 
 
Answer
packages are the namespaces to for a group of classes and
interfaces
 
0
Ravikiran(aptech Mumbai)
 
 
Question
Explain method overloading and overriding?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Method overloading: when a method in a class having the 
same method name with different arguments is said to be 
method overloading.
Method Overridding: when a method in a class having the 
same method name with same arguments is said to be method 
overridding.
 
2
Janet
 
 
Answer
Method overloading: when a method in a class having the 
same method name with different number/type of arguments 
with the existense of prevoius meaning also is called 
method overloading.
Method Overridding: when a method in a class having the 
same method name with same number & type of argument(s) 
however there mus not be any existense of previous meaning 
is said to be method 
overridding.
 
0
Chittaranjan
 
 
Answer
when we use method in a class hane same name with different 
arguments are calles method overloading
when we use methodes with same class name and same 
arguments called ovverriding
 
0
Prasad
 
 
Answer
overloading:previous answers are correct.
overriding: overriding is possible only in inheritance.
 we will have more than one methods in the same name with 
same no. of arguments with same type in different classes.
 
0
Aburar Yaseen
 
 
Answer
method overloading is the type of polymorphism with a
different argument list and same method name and can takes
place inside the same class only

method overriding is the process of writing a different
functionality having the same method signature
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
Method overloading happens in class with same method name but by modifying below features
1> By changing number of parameters 
2> By changing ordinal position of parameter , i mean to say here is by changing datatype place.
And method overriding happens in two or more than two class , i mean defining same method declaration without any modification within two class and among of that two class , one class must extend another class and further also you can override this method , and this procedure continues till one subclass leaves overriding this method.
 
0
Priyabrata Patro
 
 
Question
Define interface?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Java doesnot support multiple inheritance. 
interface is a way to achieve multiple inheritance in java,
an interface contains only abstract methods and final 
variables.
the class that implements the interface should define the 
code for the methods
 
0
Neema
 
 
Answer
interface is the one which contains all the methods as
abstract.If we wish to do a complete new functionality
implementation in the future we have to make use of interface
 
0
Ravikiran(aptech Mumbai)
 
 
Question
explain the concept of inheritance with an example?
Rank Answer Posted By  
 Question Submitted By :: Guest
This Interview Question Asked @   Polaris
I also faced this Question!!   © ALL Interview .com
Answer
Inheritence is the process by which one object acquires the 
properties of another object. by using the extends keyword.

Adv:

It is easier to reuse code
 
4
Shekar
 
 
Answer
Inheritance is a process by which an object inherits parent 
object quality.inheritance gives reusability
Consider a class Man derived class of Monkey an object of 
man inherits some of monkeys qualities and overrides some 
qualities like walking straight with two legs and have 
additional functions like speach etc..
 
0
Muthusenthil
 
 
Answer
inheritance is the proces of inheriting the properties of
super class into the subclass
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
The base class properties into derived class. This is nown 
as inheritance.

example: father and child relation. father properties power 
get the child.
 
0
Dsr
 
 
Answer
Inheritance is the process by which new classes called 
derived classes are created from existing classes called 
base classes. The derived classes have all the features of 
the base class and the programmer can choose to add new 
features specific to the newly created derived class.
 
0
Chintan
 
 
Question
What is the difference between getCodeBase and 
getDocumentBase methods?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
URL getCodeBase()
         Gets the base URL.
URL getDocumentBase()
         Gets the URL of the document in which the applet is
embedded.
 
0
Pradyut
 
 
Question
What is meant by final class, methods and variables?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
when you declare a class as final, that class cannot be 
extended.In java "String" class is final.

when you declare the variable as final then we can 
intialize it only once.it is constant.

when declare the method as final we cannot override the 
method
 
0
Narasimha
 
 
Answer
final class:Is the one which cann't be subclassed
final method:Is the one which cann't be overrided
final variable:is the one which acts like a constant
 
0
Ravikiran(aptech Mumbai)
 
 
Question
What is an exception?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
Exception is a runtime error. It is a abnormal condition 
that arises at runtime in a code sequence
 
0
Swapna
 
 
Answer
exception is the abnormal condition which will occur at run time
 
0
Ravikiran(aptech Mumbai)
 
 
Answer
when we write code and try to execute the that code error 
may be occur in runtime or complie time complie time error 
nothing but syntex error we can easily set right by 
reediting suitable code runtime error is exception. we can 
handle the exception use Exception class which is belongs 
to java.lang. package using this class handle the exception
(try catch) block
 
0
Vikneswarank
 
 
Answer
Exception is a class available in java.lang package and has 
many subclasses.
 
0
Vikas
 
 
Question
What is meant by event handling?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
One type of communications that can occur between objects is
the event. An event is any action that can be captured in code.
 
2
Vamsy Krishna
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com