Wednesday, 31 August 2011

what is jdbc? java interview questions ...

write your answers here

differents between string and string buffer? java interview questions ...

write your answers here

what is array list? java interview questions ...

write your ans here

what is map interface? java interview questions ...

write your answers here

what is exception? java interview questions ...

write your answers here....

what is list? java interview questions ...

write your answers here

what is thread? java interview questions ...

soon the answer uptade......

Tuesday, 30 August 2011

whai is set interface? java interview questions ...

 Answer :

  • Java collections Set interface is part of java.util package.
  • A set is a public interface that extends the collection interface 
  • It holds unique values(set does not contain duplicate elements).

It has two useful concrete classes that implements sets

  1. java.util.HashSet
   2.  java.util.TreeSet
                
  • Set value can get by Iterator interface.

Example:

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class SetExample {

    public static void main(String[] args) {

        // Set example with implement TreeSet
        Set<String> s=new TreeSet<String>();

        s.add("b");
        s.add("a");
        s.add("b");

        Iterator it=s.iterator();

        while(it.hasNext())
        {
          String value=(String)it.next();

          System.out.println("Value :"+value);
        }
    }
}


Output

Set Value :a
Set Value :b

  set ignore the duplicate value.

Monday, 29 August 2011

what is an interface? java interview questions ...

Ans:

  • An interface is a named collection of method declarations and constant declarations. 
  • here we only declare the methods not a implementation. 
  • it's implemented by a class using implements keyword.

syntax:

        interface interface name{

           //declaration of methods and constants

         }

        class class name implements{

       

            //implementation codes

        }

what is inheritance? java interview questions ...

Ans:

  • Java Inheritance defines an is-a relationship between a superclass and its subclasses.
  • The child class can use the methods and variables of the superclass and add to them its own methods and variables .
  • The keyword extends is used by the sub class to inherit the features of super class .
  •   Using inheritance we can achieve the concepts of reusability.

syntax:

             class A{

              //class A codes

            }

             class B{

             //class B codes and also use class A members

             }

what is encapsulation? java interview questions ...

Ans:
  • java encapsulation is  wrapping up of the data into single unit.
  • The process of hiding all the details of an object that do not contribute to its essential characteristics
  • for example if we declare the members(variable or method) public then we access the members into anywhere, but if we declare the private then we cant access the members out of class this is called encapsulation.

what is abstraction? java interview questions ...

Ans:
  • Java  Abstraction means to show only the necessary details to the client of the object .
  • without knowing the background of details we use. 
  • it is usually accomplished through the use of base classes with virtual functions , each derived function provides the details that implement the behavior behind that abstraction


what is an object? java interview questions ...

Ans:
  • Object is a run time entity.
  •  A set of data combined with methods for manipulating
        that data.

Three properties characterize objects:
  1. Identity
  2. State
  3. Behavior

Syntax:

     ClassName object ;

                  (or)

     ClassName object = new ClassName;

what is java? (or) define java? java interview questions ...

Ans:
  • java is a high level programming language developed by James Gosling for Sun  Microsystems.
  • java was originally called OAK ,later the name changed.
  • java is a neutral platform language(support all platform).
  • java is a Object Oriented Programming language.
  • java mainly developed by mobile device and internet.


Advantages:
  • Easy to Use
  • Reliability
  • Secure
  • Platform Independent  

java interview questions

  • What is the difference between procedural and object-oriented programs?
  • what is java? or define java?
  • What is the difference between Assignment and Initialization?
  • What is an Iterator?
  • What is casting?
  • what is static method?
  • What is final, finalize() and finally?
  • what is final?
  • How many ways can an argument be passed to a subroutine and explain them?
  • what id the meaning of final in variable , method and class?
  •  
  • What is OOPs?What is an Object and how do you allocate memory to it?
  • What is the difference between constructor and method?
  • what is class?
  • What is the difference between this() and super()?
  • What is the difference between an argument and a parameter?
  • What is an abstract class?
  • what is encapsulation?
  • What is daemon thread and which method is used to create the daemon thread?
    • What is meant by pass by reference and pass by value in Java?
    • What is the difference between an Interface and an Abstract class?
    • What are wrapper classes?
      • what is polymorphism?
      • Explain the usage of Java packages.
      • What is difference between overloading and overriding?
      • What is the purpose of garbage collection in Java, and when is it used?
      • what is thread?
      • what is inheritance?
      • What is the difference between superclass and subclass?
      • what is interface?
      • What is JDBC?
      • What is the difference between JDBC and ODBC?
      • What are drivers available?
      • what is swing?
      • what is diff between swing and awt?
      • What are the types of statements in JDBC?
      • What are the steps involved for making a connection with a database or how do you connect to a database?