09-04-2011, 02:59 PM
[attachment=11934]
JAVA Questions
1) Java is an objectoriented programming language.What is an object?
Answer: An object consists of some data together with a set of subroutines that manipulate that data.(An object is a kind of "module," or selfcontained entity that communicates with the rest of the world through a welldefined interface.An object should represent some coherent concept or realworld object.)
2) What is a variable?
Answer: A variable is a memory location that has been given a name so that it can easily be referred to in a program.The variable holds a value, which must be of some specified type.The value can be changed during the course of the execution of the program.
3) Java is a "platformindependent language." What does this mean?
Answer: A Java program can be compiled once into a Java Bytecode program.The compiled program can then be run on any computer that has an interpreter for the Java virtual machine.Other languages have to be recompiled for each platform on which they are going to run.The point about Java is that it can be executed on many different types of computers without being recompiled.
4) What are the different types of qualifier and What is the default qualifier?
Answer: public, protected, private, package (default)
5) What is an applet?
Answer: Applet is a program which can get downloaded into a client environment and start executing there.
6) What is a thread?
Answer: Thread is a block of code which can execute concurrently with other threads in the JVM.
7) What are the ways in which you can instantiate a thread?
Answer: Using Thread class By implementing the Runnable interface and giving that handle to the Thread class.
8) What is the difference between interface and abstract class?
Answer: Abstract class defined with methods.Interface will declare only the methods.Abstract classes are very much useful when there is some functionality across various classes.Interfaces are well suited for the class, which varies in functionality but with the same method signatures.
9) What are the different driver types available in JDBC?
Answer: The driver types available in JDBC are:
a. A JDBC-ODBC bridge
b. A native-API partly Java technology-enabled driver
c. A net-protocol fully Java technology-enabled driver
d. A native-protocol fully Java technology-enabled driver
10) What are the states of a thread?
Answer: There are four states of thread:
a. Runnable
b. Not runnable
c. Dead
d. New