Java Questions & Java FAQ

Java Questions & Java FAQ


 

Ads

Tutorials   
Hibernate Interview Questions - What is Hibernate Framework? Hibernate Interview Questions JSF Basic Interview Questions Important Interview Questions in Core Java Core java Interview Questions XML Interviews Question page8,xml Interviews Guide,xml Interviews XML Interviews Question page7,xml Interviews Guide,xml Interviews XML Interviews Question page6,xml Interviews Guide,xml Interviews XML Interviews Question page5,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page30,xml Interviews Guide,xml Interviews XML Interviews Question page29,xml Interviews Guide,xml Interviews XML Interviews Question page28,xml Interviews Guide,xml Interviews XML Interviews Question page27,xml Interviews Guide,xml Interviews XML Interviews Question page26,xml Interviews Guide,xml Interviews XML Interviews Question page25,xml Interviews Guide,xml Interviews XML Interviews Question page24,xml Interviews Guide,xml Interviews XML Interviews Question page23,xml Interviews Guide,xml Interviews XML Interviews Question page22,xml Interviews Guide,xml Interviews XML Interviews Question page21,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page18,xml Interviews Guide,xml Interviews XML Interviews Question page17,xml Interviews Guide,xml Interviews XML Interviews Question page16,xml Interviews Guide,xml Interviews XML Interviews Question page15,xml Interviews Guide,xml Interviews XML Interviews Question page14,xml Interviews Guide,xml Interviews XML Interviews Question page13,xml Interviews Guide,xml Interviews XML Interviews Question page11,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews SQL PL/SQL Terms Deadlock JSF Interview Questions Tomahawk inputCalendar tag Java Questions & Java FAQ J2EE Interviews Question page9,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page8,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page7,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page6,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page5,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page4,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page3,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page20,J2EE Interviews Guide,J2EE Interviews J2EE interview questions page2,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page19,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page18,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page17,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page16,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page15,J2EE Interviews Guide,J2EE Interviews J2EE Interviews Question page14,J2EE Interviews Guide,J2EE Interviews
Ads

Java Questions & Java FAQ

     

In this Java Question series we have listed the Java Questions which are commonly asked. Our collection of frequently asked questions (FAQ) will provide you brief answers to many common questions about the Sun Programming Language. 

Here are the list of those Java Questions and FAQs.

  1. Question: It is said that the code in a finally clause will never fail to execute, Is there any example where it fails to execute?
    Answer: Here is the example code where the finally clause code will not execute.
      public class testFinally{
    
    	public static void main(String[] args){
    		System.out.println("Executing the program");
    		  try {
    			System.out.println("In the try block");
     		        System.exit(1);
                            } finally {
    			System.out.println("In the finally.");
    
    		      }
    	     }
         }
                 

    Download the code
     

  2. Question: Why there are no global variables in Java?
    Answer: Global variables are globally accessible. Java does not support globally accessible variables due to following reasons: 
    * The global variables breaks the referential transparency
    * Global variables creates collisions in namespace.
     
  3. Question: What platforms is the Java-technology software available on?
    Answer: Sun provides ports of the Java 2 Platform for Windows 95, Windows 98, Windows NT, Windows 2000, Solaris-SPARC, Solaris-Intel, and Linux.
     
  4. Question: Where can I download latest version of Java?
    Answer: Latest version of JDK can be downloaded from Sun web site http://www.java.sun.com
     
  5. Question: Do I need to know C++ to learn Java?
    Answer: No, you don't need to know C or C++ to learn Java. Java is much simpler that C++.
     
  6. Question: What is the difference between Java and Java Script?
    Answer: In Java and Java Script only the "Java" word is common. Java is programming language from Sun. JavaScript is a programming language from Netscape, which runs in their browsers.
      
  7. Question: Differentiate between applet and application.
    Answer: Java applications runs as stand-alone application whereas applet runs in web browser. Application is a Java class that has a main() method. Applet class extends java.applet.Applet class.
     
  8. Question: How to convert String to Number in java program?
    Answer: The valueOf() function of Integer class is is used to convert string to Number. Here is the code example:
    String strId = "10";

    int id=Integer.valueOf(strId);
      

  9. Question: What is interface?
    Answer:
    In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.
    Example of Interface:
    public interface sampleInterface {
      public void functionOne();

      public long CONSTANT_ONE = 1000;
    }

      
  10. Question: How you can force the garbage collection?
    Answer: Garbage collection automatic process and can't be forced.
     

Advertisements

Ads
Share on Google+Share on Google+

Java Questions & Java FAQ

Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Java Questions & Java FAQ  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:3
Mahantesh
July 2, 2011
Java

How to set container at the end of the page or just below the buttons
Ravi
December 7, 2011
Java

What the difference betw Abstract class and interface..?
Aoy Kumar Bhagat
January 17, 2012
java programming

I want to write java program and want to run that progam, i am begainer in java programming, please send me the details procedure and required softwares. Also mention download location and installation procedure of the given software. Please solve fast.

Ads

 

Ads