GeekInterview.com
Series: Subject: Topic:

Java OOPS Interview Questions

Showing Questions 21 - 38 of 38 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

What is the purpose/uses of run-time polymorphism? Is dynamic binding only way to achieve run-time polymorphism?

Asked By: JulieAsh07 | Asked On: Jul 24th, 2007

Answered by: sflebrun on: Sep 15th, 2009

Run-time polymorphism provides the ability to use late-binding.  In other words, the function called or the data member accessed is not determined until run-time and is based on the type that a v...

Answered by: goksn on: Sep 14th, 2009

Purpose of Runtime polymorphism:Run time polymorphism is a mechanism by which a call to overriden function is resolved at runtime rather than compile time.For e.gIf (user clicks link 1) then{obj1.over...

Inner classes

Asked By: jrcheenu | Asked On: Apr 23rd, 2008

What are advantages of inner class

Star Read Best Answer

Editorial / Best Answer

Answered by: ssalguti

View all answers by ssalguti

Member Since Apr-2008 | Answered On : Apr 25th, 2008

Logical grouping of classes—If a class is useful to only one other class, then it is logical to embed it in that class and keep the two together. Nesting such "helper classes" makes their package more streamlined.

Increased encapsulation—Consider two top-level classes, A and B, where B needs access to members of A that would otherwise be declared private. By hiding class B within class A, A's members can be declared private and B can access them. In addition, B itself can be hidden from the outside world.

More readable, maintainable code—Nesting small classes within top-level classes places the code closer to where it is used.

Answered by: goksn on: Sep 14th, 2009

Defining a class within another class is known as nested class.

If class B is defined within class A, then B is known to A, but not outside of A.

Class B has access to the members, including private members of the Class A.

However,the class A does not have access to the members of Class B.

Answered by: ssalguti on: Apr 25th, 2008

Logical grouping of classes—If a class is useful to only one other class, then it is logical to embed it in that class and keep the two together. Nesting such "helper classes" makes th...

What is aggregation and composition of objects?What is the diff between monolithic and composite object?

Asked By: din | Asked On: Mar 28th, 2006

Answered by: talktoatish on: Aug 19th, 2009

A monolithic object is an object that has no externally-discernible structure. Said another way, a monolithic object does not appear to have been constructed from two or more other objects. Spec...

Answered by: rajagobals on: Sep 14th, 2006

Aggregation differs from ordinary composition in that it does not imply ownership. In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necess...

What is run time polymorpism and complie time polymmorpism

Asked By: yaduvancy | Asked On: Jan 27th, 2006

Answered by: madhusudan_ds on: Jun 23rd, 2009

I think siva got it correct. There is no such thing exists as compile time polymorphism.Unless otherwise you run a program how does it (JRE) actually know, what to do? I mean without executing the pro...

Answered by: laikka_buddy on: May 5th, 2008

Hi  every body

Overloading is Compile time Polymorphism
Overriding is Run time Polymorphism

Please dont  confuse  everything 

Mail  me  for any  questions   and  my  id  is   sv.vgayathri@gmail.com

Serializable is used to read or write the object and find the state of an object. What is the use of finding the state of an object, explain with an example?

Asked By: gobinath.l | Asked On: May 10th, 2007

Answered by: VenkitaKrishnan on: Apr 20th, 2009

The concept of Serializable is that we can recreate the state of an object from a permanent source like a file, xml etc.Example: I had personally implemented used in scenario where i had an organizati...

Answered by: richakharya on: Apr 19th, 2009

When the object supposed to be sent across the network serializing technique makes sure the data is not lost in case of network failure. Seralizaing  is converting the object to its byte code form and then sending it accross the network.

How the abstract classes in cmp are converted into concrete classes?

Asked By: Interview Candidate | Asked On: Aug 4th, 2005

Answered by: pokiri on: Oct 29th, 2008

By extending the abstract class by other class and creating object to that class

Answered by: BINOD KUMAR MISHRA on: Aug 4th, 2005

I want to maintain our LAN through JAVA can U help me ?

What is the need of an abstract class?

Asked By: Chandrashekhar | Asked On: Aug 27th, 2007

If I write all of concrete methods in one class and all abstract methods in an interface and extend and implement both in third class assume that third class don't extend any other class?

Answered by: alkumar2000 on: Aug 15th, 2008

Abstract is most useful when you are creating a framework..take the example of template method pattern which is used in the templates provided by spring framework for the support of jdbc or hibernate...

Answered by: sampra on: Feb 13th, 2008

If we have some method which body is not defined till declartion of class and body is implemented in subclass later then declare that class as abstract class.If a class has atlest one abstract method then we have to declare class as abstract class

Which one of the following describes the oo concept of aggregation? 1.A system of objects that implement each other 2.A system of objects that are built using each other 3.A system of objects that define...

Asked By: Sateesh | Asked On: Sep 18th, 2006

Answered by: sujatatewari on: Aug 5th, 2008

2. A system of Objects that are build using each other

Answered by: Rajesh Madam on: Jul 21st, 2008

1.A system of objects that implement each other

How can I call a funtion,given its name as string?

Asked By: smita | Asked On: Oct 23rd, 2006

Answered by: sampra on: Mar 10th, 2008

Class clsObj = Class.forName("ClassName");
   Method method = clsObj.getMethod("methodName",null);
   method.invoke(clsObj.newInstance(),null);

Answered by: ashishvyas_83 on: Mar 1st, 2007

we can also call the method using Introspection API, Eclipse uses this API to get the name of all the methods available in a class after we enter "." after a Class Instance or Class Name for static methods;

Why in case of Java header file name is not required ?

Asked By: hiresh kumar chandrakar | Asked On: Mar 1st, 2006

Answered by: sampra on: Mar 10th, 2008

here we are using package

Answered by: CHANDRA SEKHAR JONNALAGADDA on: Jun 10th, 2006

               hi friends java having a classes and packeges so no need to header file in java. so header file is not required. by...

What is uni code

Asked By: sanoosh | Asked On: Oct 18th, 2005

Answered by: sampra on: Mar 10th, 2008

in unicode all character availbale in the world has been assign with a unique number that is for internationalization

Answered by: Jagadeesh.gowd on: Jul 26th, 2007

What is Unicode? Unicode provides a unique number for every character, no matter what the platform, no matter what the program, no matter w...

What is diff between union / union all

Asked By: SUNDARAMOORTHYS | Asked On: Mar 16th, 2006

Answered by: sampra on: Feb 13th, 2008

Union dosent allow duplicate value
Union all allows duplicate value

Answered by: ramanareddy devarapalli on: Jun 18th, 2007

UNION does it will not allows duplicate value, where as UNION ALL allows the duplicate values.

What is an inline class?

Asked By: Kanchan | Asked On: Aug 14th, 2007

Answered by: sampra on: Feb 13th, 2008

A class which is define inside a class is known as inner class inner class can be static but top level class can not be static.

What is the difference between unicode and hash code?

Asked By: chandrasekhar | Asked On: Mar 27th, 2006

Answered by: sampra on: Feb 13th, 2008

Unicode is used for globlization ie its support all  languages  its use for globlization where as hash code is a unique number which is given to object by JVM .hash code is implement by some...

Answered by: sarithahere528 on: Oct 23rd, 2007

equal objects should have the same hashcode ...
i.e when u go for overridding a equal() method , u should override hashcode() also

What are Java archives?

Asked By: sujit | Asked On: Aug 28th, 2006

Answered by: sampra on: Feb 13th, 2008

Java archive is the collection of builtinn or user define packages(.class file)

Answered by: sarithahere528 on: Oct 23rd, 2007

Friends i have a small doubt ...
i heard that Jar will supported by all platforms and Zip wont suport
is it true ?

How to connect the crystal reports to the JSP applications

Asked By: amrez25 | Asked On: Nov 10th, 2006

Answered by: Senthil on: Nov 14th, 2006

Hi,

  Pls go the below link, you will get the solution for your problem

http://support.businessobjects.com/communityCS/FilesAndUpdates/bexi_jsp_samples.zip.asp

Thanks and Regards,

Senthil C.R.

Class outer{int a;outer (){a=10;}public static void main(string args[]){final outer o1=new outer();outer o2=new outer();class inner{inner(){o1.A=20;//allowed//o2.A=30; not allowed}}}}why inner classes...

Asked By: sunil_dalvi82 | Asked On: May 8th, 2006

Answered by: Kumar on: Aug 21st, 2006

Inner classes can also access method parameters that are declared to be final.

Answered by: omaha_inky on: Jun 1st, 2006

From www.javaranch.com:The inner class can't use local variables from the method in which the inner class is defined! After all, at the end of that method, the local variables will be blown away. Poof...

What are the three steps to deploy ejb?

Asked By: alok | Asked On: Nov 21st, 2005

Answered by: hmashruf on: Apr 6th, 2006

Hi,

The final step should be to deploy deployable jar.

With Best Regards

-ashruf

Answered by: zhousx18 on: Dec 26th, 2005

1.Adjust Deployment Descriptors

2.Perform Server-Specific Configuration

3.Generate Container-Specific Classes

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.