Java interview questions and answers

Ads
 

Java interview questions and answers

  1. what is garbage collection? What is the process that is responsible for doing that in java?

Ans.Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process

2.What kind of thread is the Garbage collector thread?

Ans. It is a daemon thread.

3.What is a daemon thread?

Ans.These are the threads which can run without user intervention. The JVM can exit when there are daemon thread by killing them abruptly.

4.How will you invoke any external process in Java?

Ans. Runtime.getRuntime().exec(?.)

5.What is the basic difference between string and stringbuffer object?

Ans. String is an immutable object. StringBuffer is a mutable object.

6.

View Answers

April 18, 2011 at 2:30 PM

//java program for static member method

public class staticc{

int i;

static int j;

public static void staticMethod(){

System.out.println("you can access a static method this way");

}

public void nonStaticMethod(){

i=100;
j=1000;
System.out.println("Don't try to access a non static method");

}

public static void main(String[] args) { //i=100;

 j=1000;
//nonStaticMethod();
staticMethod();

} }


November 9, 2011 at 5:29 PM

String objects are constants and immutable where as StringBuffer objects are not.StringBuffer Class supports growable and modifiable string where as String class supports constant strings. Strings once created we cant modify them. Any such attempt will lead to the creation of new strings.Where as StingBuffer objects after creation also can be able to delete oo append any characteres to it.String values are resolved at run time where as StringBuffer valuesc are resolved at compile time.So if you know the exact size of the string to be appended it is better to go for String objects.


November 22, 2011 at 9:36 PM

Nice Collections of Java Interview question. It really helpful for beginner as well as developer. Check following link too, It is also having a nice collection on Java interview question...

http://mindstick.com/Interviewer/QuestionPage.aspx?topicid=10&topic=Java

Thanks everyone for your nice collection.

Ads









Related Tutorials/Questions & Answers:
Java interview questions and answers
Java interview questions and answers   what is garbage collection? What is the process that is responsible for doing that in java? Ans.Reclaiming... in Java? Ans. Runtime.getRuntime().exec(?.) 5.What is the basic difference
Core Java Interview questions and answers
Core Java Interview questions and answers  ... and answers in one place. These Core Java Interview Questions are supported... the answers. We are constantly trying to provide best Core Java Interview questions. You
Advertisements
Java Interview Questions with Answers
Java Interview Questions with Answers for freshers Are you looking for largest database of interview questions for preparing for your interviews then you... in Java. Go through all these interview questions and this will help you
Interview Questions - What is Java?
Interview Questions - What is Java?  What is Java?   Hi, Java is high level programming langue developed by James Gosling. Now Java.... Check in detail at: What is Java? View all Java Interview Questions
Java Interview Questions
Java Interview Questions  Hi, Can anyone tell the urls of Java Interview Questions on roseindia.net? Thanks
Interview Questions - Where Java is used?
being Used?. View all interview questions at Java Interview Questions with Answers...Interview Questions - Where Java is used?  Hello, Where Java is used? Thanks   Hi, Java is used for creating various types
Interview Questions - How Java is Used?
For Creating Applets Check: Where is Java being Used? View all interview questions at Java Interview Questions with Answers page. Thanks...Interview Questions - How Java is Used?  Hi, How Java is Used
Interview Questions - What are important features of Java?
Interview Questions - What are important features of Java?  Hi, What.... Check All Java Features. View all interview questions at Java Interview Questions with Answers page
Java - Java Interview Questions
Java  definition for "USER DEFINE PACKAGE FOR JAVA
Java - Java Interview Questions
Java  What is meant by Stream Tokenizer ?   hi friend, To understand the Stream Tokenizer, visit to: http://www.roseindia.net/java/example/java/io/tokenizingjavasourcecode.shtml Thanks RoseIndia Team
Java interview questions
Java interview questions  Plz answer the following questions..... The type long can be used to store values in the following range: a. -263 to 263 - 1 b. -231 to 231 - 1 c. -264 to 264 d. -232 to 232 - 1 Which
Java - Java Interview Questions
it as System.out.println(); For more information on Java visit to : http://www.roseindia.net/java/ Thanks
java - Java Interview Questions
out = new BufferedWriter(fstream); out.write("Hello Java"); //Close
Interview Questions - What are important Java Language Elements?
. View all interview questions at Java Interview Questions with Answers page...Interview Questions - What are important Java Language Elements?  Hi, What are important Java Language Elements? Thanks   Hi, Java
j2ee - Java Interview Questions
in init() method of a servlet.Give me the correct answers....... with explanation
cms - Java Interview Questions
alfresco concepts in core java,webapplications and webservices).i haver some information in net,i want how to implement alfresco in core java
urgent - Java Interview Questions
display the url one by one.using core java technology (e.g)when am requesting...://www.roseindia.net/java/example/java/io/file-url-download.shtml Thanks
Java - Servlet Interview Questions
Difference between server and application server for Java  What is the difference between server and application server for Java?  Hello,Here is the differenceWeb server:* Servers Static contents* Directly receives
Interview Questions - What are important Java Editions or Parts of Java?
and Tutorials. View all interview questions at Java Interview Questions with Answers...Interview Questions - What are important Java Editions or Parts of Java?  Hi, What are important Java Editions or Parts of Java? How many components
Interview Questions - What is JRE?
and JVM? View all interview questions at Java Interview Questions with Answers...Interview Questions - What is JRE?  Hi, What is JRE? Thanks   Hi, JRE is known as Java Runtime Environment and its minimal components
Software Questions and Answers
from within Java program. JMS - JMS questions and answers.... Java Interview Questions - Discuss Java Interview Questions here... Hibernate Interview questions and browser the answers. JUNIT - The Junit
Interview Questions - What is JDK?
. Check: Beginners Java Tutorials - Installing JDK. View all interview questions at Java Interview Questions with Answers page. Thanks   Video tutorial...Interview Questions - What is JDK?  Hi, What is JDK? Thanks  
help needed - Java Interview Questions
help needed  What are the new features added in jdk 1.5?  Hi friend, The following were the new features added in java 1.5. * Generics * Enhanced for loop * Metadata * Static import * Typesafe enums
Software Questions and Answers
the answers of the questions asked. JavaMail - Java API to send... questions here. Java Interview Questions - Discuss Java... Questions - Ask Hibernate Interview questions and browser the answers
Core java Interview Questions
Here are the Core Java Interview Questions that can be asked to you by interviewers. These frequently asked Core Java Interview Questions will be beneficial to software developers going for Java developer Interviews. Q 1. Difference
Interview Questions - What are the Fundamentals of OOPS?
Concept and OOPs concepts in Java. View all interview questions at Java Interview Questions with Answers page. Thanks...Interview Questions - What are the Fundamentals of OOPS?  Hi, What
Important Interview Questions in Core Java
Important Interview Questions in Core Java Core Java refers..., interviewer can ask any questions in the stock pile of core java questions and answers... questions. Mastering in Java is a different thing and facing an interview
Hibernate interview Questions
Hibernate interview Questions  Pl share hibernate interview questions.I have found one popular website to learn java J2EE technology, but in that they have currently not updated interview questions. They have explain so many new
java application Performance optimization - Java Interview Questions
java application Performance optimization  Please tell me brief or some useful links about java application performance opotimization
Questions and Answers Help
Questions and Answers Help      ...://www.roseindia.net/answers/viewqa/Java-Beginners/11976-Java-Hello-World-code-example.html Ask Questions | Browse Latest Questions and Answers
Questions and Answers Help
Questions and Answers Help      ...://www.roseindia.net/answers/viewqa/Java-Beginners/11976-Java-Hello-World-code-example.html Ask Questions | Browse Latest Questions and Answers

Ads