GeekInterview.com
Series: Subject: Topic:

Java Classes FAQs

Showing Questions 1 - 20 of 78 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

What is difference between abstract class and interface

Asked By: apt_dpl | Asked On: Feb 11th, 2006

Answered by: UMA on: Jan 22nd, 2013

polymorphism are mainly two types static polymorphism(corresponding method will bind at the time of compiling) dynamic polymorphism(corresponding method will bind at the run time) Static polymorphi...

Answered by: sharoon on: Sep 26th, 2012

In a very simple and high level, Interface is something to tell a guy, Hey X, you should to all these if you need me whereas abstract class tells Hey X, you should do this alone need not to disturb others.

Regarding to strings

Asked By: yekkalarajesh | Asked On: Jun 24th, 2012

Class string{ public static void main(string args[]){ } }

What do you mean by static methods?

Asked By: n.rajesh | Asked On: Jan 2nd, 2012

Answered by: sourabh on: May 11th, 2012

Static methods dont need class objects to call them where as nonstatic methods needs class objects to call them

Java does not supports recursion

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) trueb) false

Answered by: nidhi on: Oct 14th, 2011

Java supports recursion

Answered by: sunnysoori on: Aug 19th, 2008

false

Can a abstract class have a constructor ?When would the constructor in the abstract class be called ?

Asked By: devs | Asked On: Dec 14th, 2006

All the classes including the abstract classes can have constructors.Abstract class constructors will be called when its concrete subclass will be instantiated.

Answered by: Amms on: Sep 30th, 2011

Abstract class constructor can be called from the subclass that is extending this abstract class. You would define a constructor in an abstract class if you are in one of these situations: •you wa...

Answered by: navneetgoyal2000 on: Jan 6th, 2011

Yes, Abstract Class can have Constructor, infact I would say it SHOULD have constructor.As ABS class is not a class WITH NO FUNCTIONALITY, it always can HAVE some common functionality.Please understan...

The data, or variables, defined within a class are called _______ variables

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) objectb) classc) instance d) none of the above

Answered by: Shakti on: Jul 21st, 2011

Instance variables

Answered by: sarthak1 on: Nov 21st, 2008

The answer can also be instance variables as they are also defined inside a class althought they can belong to objects in particular.

In interfaces the methods just defined without implementation then what is the purpose of defining the methods?

Asked By: prakash | Asked On: Sep 26th, 2005

Answered by: Deepak agnihotri on: Nov 26th, 2010

An Interface force the end user to implement all the methods declared in the interface, in this way it is ensured that all the extending classes of a particular interface are ...

Answered by: chaitu on: Aug 8th, 2007

We declare methods in interfaces, by declaring these methods we provide signature of method to the class which implements this class.one interface can be implemented by any number of classes. By impl...

What are the advantage of servlet over JSP and what are advantage of JSP over Java?

Asked By: arulmurugan | Asked On: Jan 3rd, 2006

Answered by: bhadrinath on: Jun 16th, 2010

The first step is to understand the difference between the two..1. JSP is mailny used for displaying data but servlet is used for providing the business logic2. JSP can support only HTTP protocol wher...

Answered by: surya on: Jan 3rd, 2006

Advantages of Servlets over jsps:-(1)servlets are comparatively faster than jsps.Advantages of Jsps over servlets:-(1)Easy to write and maintain and comparatively developer friendly(2)Developer provid...

How to implement hibernate

Asked By: saeed4java | Asked On: Sep 23rd, 2006

Answered by: drjava72 on: Mar 16th, 2010

Rather creating mapping file try Annotations they are best and they take less time and they are efficient. You can reverse engineer them using net beans.

Answered by: Arun K Rajput on: Dec 1st, 2006

following things needed

1. put hibernate3.jar in project lib

2. write hibernate configuration file (ie) hibernate.cfg

3. write hibernate mapping file (say) student.hbm.xml

4. get hibernate session and begin transaction

5 end

bye

Explain abt try-catch-finally ?What is the exact use?

Asked By: suresh | Asked On: Feb 25th, 2006

Answered by: drjava72 on: Mar 16th, 2010

Try Catch are necessary for checked exceptions and you can use them for unchecked exceptions.Suspecious code is written in try and exception is handled in catch block and the finally block will execute every time weather exception is raised or not.

Answered by: Vickey on: Nov 28th, 2006

In java ... we often get free errors ... Somtimes ... the error might be in  syntax those errors as know as Complication errors ... and the seconf type of errors is Runtime errors ...i.e.. the pr...

How to run doc file in Java?

Asked By: ashish | Asked On: Dec 27th, 2005

Answered by: sandeep.gurusthale on: Feb 26th, 2010

Here is the correct code for this. Save anywhere your document file it search and open. import java.io.*;public class Example {    public static void main (String[] args) throws IOExcep...

Answered by: anshuman on: Apr 15th, 2007

I have used your source code
it opens the word software but it does not open the file
it is saying that permission is not there
pls provide some help on it

System class

Asked By: nikhil.petkar | Asked On: May 7th, 2009

What is the use of system class?

Answered by: zero10 on: Jan 26th, 2010

Well it depends upon you for what purpose do use system class.Say, System.in >> belongs to inputstream interface helps in inputting from the console.whereas, System.out and System.err is used to...

Answered by: myogeshchavan97 on: May 8th, 2009

System class is used to provide access to the system resources.

A class is a template for an object, and an object is an instance of a class.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) trueb) false

Answered by: zero10 on: Jan 26th, 2010

Well said and its True that class is a template for an obejct(s) because all the objects are combined to form class as they all have similar features.

Cheers

Answered by: sneh lata on: Sep 15th, 2007

true
A class is a template for multiple objects with similar features

What is meant by pre-emptive scheduling?

Asked By: pallavi | Asked On: May 3rd, 2006

Answered by: jawaharl0207 on: Oct 26th, 2009

Fixed priority pre-emptive scheduling is a scheduling system commonly used in real-time systems. With fixed priority pre-emptive scheduling, the scheduler ensures that at any given time, the processor executes the highest priority task of all those tasks that are currently ready to execute.

Answered by: gangaprasadgd on: Oct 24th, 2009

Fixed priority pre-emptive scheduling is a scheduling system commonly used in real time systems With fixed priority pre-emptive scheduling, the scheduler ensures that at any given time, the processor executes the highest priority task of all those tasks that are currently ready to execute.

In this example class-var = new classname( ); class-var is a variable of the class type being created

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) trueb) false

Answered by: tarun_1984 on: Jun 19th, 2009

In this Question in the given example class-var is nothing but an object of class classname

Answered by: ksrikanth5g on: Jul 24th, 2008

no its not create a object

What is the output of the following? // a simple example of recursion.Class factorial { // this is a recursive method int fact(int n) { int result; if(n==1) return 1; result = fact(n-1) *...

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) factorial of 3 is 3b) factorial of 3 is 6c) factorial of 3 is 9d) none of the above

Answered by: r.praveenkumar on: Feb 25th, 2009

Ans is (d) None of the above

Because we are not defining else part of the if statement.

Unreachable code error because of the absence of else part.

Answered by: Sheriffh on: Feb 24th, 2009

D)None of the above

How to send email using Java?

Asked By: baba | Asked On: Apr 30th, 2007

Answered by: vijays on: Jan 16th, 2009

 Java Mail API is ued to send a Mail through java application. To Test Program all you need to have is a SMTP address (Which your ISP Provides). We will see a sample program to send a mail through j...

Explain Java classes in detail?

Asked By: mallikarjun rao.Y | Asked On: Jan 2nd, 2007

Answered by: vijays on: Jan 16th, 2009

The Java class file is a precisely defined format for compiled Java. Java source code is compiled into class files that can be loaded and executed by any JVM. The class files may travel across a netwo...

How to convert .Class file to .Exe file

Asked By: yahya | Asked On: May 5th, 2007

Answered by: vijays on: Jan 16th, 2009

This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an executable application when deploying your applications to a specific platform, but remember to make your .class files available for users running Unix/Macintosh/other platforms.

Any concept you wish to implement in a Java program must be encapsulated within a class.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) trueb) false

Answered by: nakkella on: Nov 13th, 2008

flase

Answered by: pankaj on: Dec 27th, 2005

True as u can only define methods n variables in interfaces but your implementation will always be in class.

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.