1. What is the difference between an Abstract class and Interface ?
2. What is user defined exception ?
3. What do you know about the garbage collector ?
4. What is the difference between C++ & Java ?
5. Explain RMI Architecture?
6. How do you communicate in between Applets & Servlets ?
7. What is the use of Servlets ?
8. What is JDBC? How do you connect to the Database ?
9. In an HTML form I have a Button which makes us to open another page in 15 seconds. How will do you that ?
10. What is the difference between Process and Threads ?
11. What is the difference between RMI & Corba ?
12. What are the services in RMI ?
13. How will you initialize an Applet ?
14. What is the order of method invocation in an Applet ?
15. When is update method called ?
16. How will you pass values from HTML page to the Servlet ?
17. Have you ever used HashTable and Dictionary ?
18. How will you communicate between two Applets ?
19. What are statements in JAVA ?
20. What is JAR file ?
21. What is JNI ?
22. What is the base class for all swing components ?
23. What is JFC ?
24. What is Difference between AWT and Swing ?
25. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?
26. How does thread synchronization occurs inside a monitor ?
27. How will you call an Applet using a Java Script function ?
28. Is there any tag in HTML to upload and download files ?
29. Why do you Canvas ?
30. How can you push data from an Applet to Servlet ?
31. What are 4 drivers available in JDBC ?
32. How you can know about drivers and database information ?
33. If you are truncated using JDBC, How can you know ..that how much data is truncated ?
34. And What situation , each of the 4 drivers used ?
35. How will you perform transaction using JDBC ?
36. In RMI, server object first loaded into the memory and then the stub reference is sent to the client ? or whether a stub reference is directly sent to the client ?
37. Suppose server object is not loaded into the memory, and the client request for it , what will happen?
38. What is serialization ?
39. Can you load the server object dynamically? If so, what are the major 3 steps involved in it ?
40. What is difference RMI registry and OSAgent ?
41. To a server method, the client wants to send a value 20, with this value exceeds to 20,. a message should be sent to the client ? What will you do for achieving for this ?
42. What are the benefits of Swing over AWT ?
43. Where the CardLayout is used ?
44. What is the Layout for ToolBar ?
45. What is the difference between Grid and GridbagLayout ?
46. How will you add panel to a Frame ?
47. What is the corresponding Layout for Card in Swing ?
48. What is light weight component ?
49. Can you run the product development on all operating systems ?
50. What is the webserver used for running the Servlets ?
51. What is Servlet API used for connecting database ?
52. What is bean ? Where it can be used ?
53. What is difference in between Java Class and Bean ?
54. Can we send object using Sockets ?
55. What is the RMI and Socket ?
56. How to communicate 2 threads each other ?
57. What are the files generated after using IDL to Java Compilet
Showing posts with label Java Interview Questions. Show all posts
Showing posts with label Java Interview Questions. Show all posts
Saturday, March 6, 2010
Pragramming Related Java Questions
What is a class?
A class is a blueprint, or prototype, that defines the variables and the methods common to all objects of a certain kind.
What is a object?
An object is a software bundle of variables and related methods.An instance of a class depicting the state and behavior at that particular time in real world.
What is a method?
Encapsulation of a functionality which can be called to perform specific tasks.
What is encapsulation? Explain with an example.
Encapsulation is the term given to the process of hiding the implementation details of the object. Once an object is encapsulated, its implementation details are not immediately accessible any more. Instead they are packaged and are only indirectly accessible via the interface of the object
What is inheritance? Explain with an example.
Inheritance in object oriented programming means that a class of objects can inherit properties and methods from another class of objects.
What is polymorphism? Explain with an example.
In object-oriented programming, polymorphism refers to a programming language’s ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes. For example, given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying the area method to it will return the correct results. Polymorphism is considered to be a requirement of any true object-oriented programming language
Is multiple inheritance allowed in Java?
No, multiple inheritance is not allowed in Java.
What is interpreter and compiler?
Java interpreter converts the high level language code into a intermediate form in Java called as bytecode, and then executes it, where as a compiler converts the high level language code to machine language making it very hardware specific
What is JVM?
The Java interpreter along with the runtime environment required to run the Java application in called as Java virtual machine(JVM)
What are the different types of modifiers?
There are access modifiers and there are other identifiers. Access modifiers are public, protected and private. Other are final and static.
What are the access modifiers in Java?
There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.
A class is a blueprint, or prototype, that defines the variables and the methods common to all objects of a certain kind.
What is a object?
An object is a software bundle of variables and related methods.An instance of a class depicting the state and behavior at that particular time in real world.
What is a method?
Encapsulation of a functionality which can be called to perform specific tasks.
What is encapsulation? Explain with an example.
Encapsulation is the term given to the process of hiding the implementation details of the object. Once an object is encapsulated, its implementation details are not immediately accessible any more. Instead they are packaged and are only indirectly accessible via the interface of the object
What is inheritance? Explain with an example.
Inheritance in object oriented programming means that a class of objects can inherit properties and methods from another class of objects.
What is polymorphism? Explain with an example.
In object-oriented programming, polymorphism refers to a programming language’s ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes. For example, given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying the area method to it will return the correct results. Polymorphism is considered to be a requirement of any true object-oriented programming language
Is multiple inheritance allowed in Java?
No, multiple inheritance is not allowed in Java.
What is interpreter and compiler?
Java interpreter converts the high level language code into a intermediate form in Java called as bytecode, and then executes it, where as a compiler converts the high level language code to machine language making it very hardware specific
What is JVM?
The Java interpreter along with the runtime environment required to run the Java application in called as Java virtual machine(JVM)
What are the different types of modifiers?
There are access modifiers and there are other identifiers. Access modifiers are public, protected and private. Other are final and static.
What are the access modifiers in Java?
There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.
Java networking and algaritms questions
1. What is the protocol used by server and client ?
2. Can I modify an object in CORBA ?
3. What is the functionality stubs and skeletons ?
4. What is the mapping mechanism used by Java to identify IDL language ?
5. Diff between Application and Applet ?
6. What is serializable Interface ?
7. What is the difference between CGI and Servlet ?
8. What is the use of Interface ?
9. Why Java is not fully objective oriented ?
10. Why does not support multiple Inheritance ?
11. What it the root class for all Java classes ?
12. What is polymorphism ?
13. Suppose If we have variable ‘ I ‘ in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
14. In servlets, we are having a web page that is invoking servlets username and password ? which is checked in the database ? Suppose the second page also If we want to verify the same information whether it will connect to the database or it will be used previous information?
15. What are virtual functions ?
16. Write down how will you create a binary Tree ?
17. What are the traverses in Binary Tree ?
18. Write a program for recursive Traverse ?
19. What are session variable in Servlets ?
20. What is client server computing ?
21. What is Constructor and Virtual function? Can we call Virtual function in a constructor ?
22. Why we use OOPS concepts? What is its advantage ?
23. What is the middleware ? What is the functionality of Webserver ?
24. Why Java is not 100 % pure OOPS ? ( EcomServer )
25. When we will use an Interface and Abstract class ?
26. What is an RMI?
27. How will you pass parameters in RMI ? Why u serialize?
28. What is the exact difference in between Unicast and Multicast object ? Where we will use ?
29. What is the main functionality of the Remote Reference Layer ?
30. How do you download stubs from a Remote place ?
31. What is the difference in between C++ and Java ? can u explain in detail ?
32. I want to store more than 10 objects in a remote server ? Which methodology will follow ?
33. What is the main functionality of the Prepared Statement ?
34. What is meant by static query and dynamic query ?
35. What are the Normalization Rules ? Define the Normalization ?
36. What is meant by Servlet? What are the parameters of the service method ?
37. What is meant by Session ? Tell me something about HTTPSession Class ?
38. How do you invoke a Servlet? What is the difference in between doPost and doGet methods ?
39. What is the difference in between the HTTPServlet and Generic Servlet ? Explain their methods ? Tell me their parameter names also ?
40. Have you used threads in Servlet ?
41. Write a program on RMI and JDBC using StoredProcedure ?
42. How do you sing an Applet ?
43. In a Container there are 5 components. I want to display the all the components names, how will you do that one ?
44. Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?
45. Tell me the latest versions in JAVA related areas ?
46. What is meant by class loader ? How many types are there? When will we use them ?
47. How do you load an Image in a Servlet ?
48. What is meant by flickering ?
49. What is meant by distributed Application ? Why we are using that in our applications ?
50. What is the functionality of the stub ?
51. Have you used any version control ?
52. What is the latest version of JDBC ? What are the new features are added in that ?
53. Explain 2 tier and 3 -tier Architecture ?
54. What is the role of the webserver ?
55. How have you done validation of the fields in your project ?
56. What is the main difficulties that you are faced in your project ?
57. What is meant by cookies ? Explain
2. Can I modify an object in CORBA ?
3. What is the functionality stubs and skeletons ?
4. What is the mapping mechanism used by Java to identify IDL language ?
5. Diff between Application and Applet ?
6. What is serializable Interface ?
7. What is the difference between CGI and Servlet ?
8. What is the use of Interface ?
9. Why Java is not fully objective oriented ?
10. Why does not support multiple Inheritance ?
11. What it the root class for all Java classes ?
12. What is polymorphism ?
13. Suppose If we have variable ‘ I ‘ in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared ?
14. In servlets, we are having a web page that is invoking servlets username and password ? which is checked in the database ? Suppose the second page also If we want to verify the same information whether it will connect to the database or it will be used previous information?
15. What are virtual functions ?
16. Write down how will you create a binary Tree ?
17. What are the traverses in Binary Tree ?
18. Write a program for recursive Traverse ?
19. What are session variable in Servlets ?
20. What is client server computing ?
21. What is Constructor and Virtual function? Can we call Virtual function in a constructor ?
22. Why we use OOPS concepts? What is its advantage ?
23. What is the middleware ? What is the functionality of Webserver ?
24. Why Java is not 100 % pure OOPS ? ( EcomServer )
25. When we will use an Interface and Abstract class ?
26. What is an RMI?
27. How will you pass parameters in RMI ? Why u serialize?
28. What is the exact difference in between Unicast and Multicast object ? Where we will use ?
29. What is the main functionality of the Remote Reference Layer ?
30. How do you download stubs from a Remote place ?
31. What is the difference in between C++ and Java ? can u explain in detail ?
32. I want to store more than 10 objects in a remote server ? Which methodology will follow ?
33. What is the main functionality of the Prepared Statement ?
34. What is meant by static query and dynamic query ?
35. What are the Normalization Rules ? Define the Normalization ?
36. What is meant by Servlet? What are the parameters of the service method ?
37. What is meant by Session ? Tell me something about HTTPSession Class ?
38. How do you invoke a Servlet? What is the difference in between doPost and doGet methods ?
39. What is the difference in between the HTTPServlet and Generic Servlet ? Explain their methods ? Tell me their parameter names also ?
40. Have you used threads in Servlet ?
41. Write a program on RMI and JDBC using StoredProcedure ?
42. How do you sing an Applet ?
43. In a Container there are 5 components. I want to display the all the components names, how will you do that one ?
44. Why there are some null interface in java ? What does it mean ? Give me some null interfaces in JAVA ?
45. Tell me the latest versions in JAVA related areas ?
46. What is meant by class loader ? How many types are there? When will we use them ?
47. How do you load an Image in a Servlet ?
48. What is meant by flickering ?
49. What is meant by distributed Application ? Why we are using that in our applications ?
50. What is the functionality of the stub ?
51. Have you used any version control ?
52. What is the latest version of JDBC ? What are the new features are added in that ?
53. Explain 2 tier and 3 -tier Architecture ?
54. What is the role of the webserver ?
55. How have you done validation of the fields in your project ?
56. What is the main difficulties that you are faced in your project ?
57. What is meant by cookies ? Explain
Java Interview Questions
1. Why do you prefer Java?
Answer: write once ,run anywhere.
2. Name some of the classes which provide the functionality of collation?
Answer: collator, rulebased collator, collationkey, collationelement iterator.
3. Awt stands for? and what is it?
Answer: AWT stands for Abstract window tool kit. It is a is a package that provides an integrated set of classes to manage user interface components.
4. why a java program can not directly communicate with an ODBC driver?
Answer: Since ODBC API is written in C language and makes use of pointers which Java can not support.
5. Are servlets platform independent? If so Why? Also what is the most common application of servlets?
Answer: Yes, Because they are written in Java. The most common application of servlet is to access database and dynamically construct HTTP response
6.What modifiers may be used with top-level class?
public, abstract and final can be used for top-level class.
7.What are inner class and anonymous class?
Inner class : classes defined in other classes, including those defined in methods are called inner classes. An inner class can have any accessibility including private.
Anonymous class : Anonymous class is a class defined inside a method without a name and is instantiated and declared in the same place and cannot have explicit constructors.
8.What is a package?
A package is a collection of classes and interfaces that provides a high-level layer of access protection and name space management.
9.What is a reflection package?
java. lang. reflect package has the ability to analyze itself in runtime.
10.What is interface and its use?
Interface is similar to a class which may contain method’s signature only but not bodies and it is a formal set of method and constant declarations that must be defined by the class that implements it. Interfaces are useful for: a)Declaring methods that one or more classes are expected to implement b)Capturing similarities between unrelated classes without forcing a class relationship. c)Determining an object’s programming interface without revealing the actual body of the class.
11.What is an abstract class?
An abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete.
12.What is the difference between Integer and int?
a) Integer is a class defined in the java. lang package, whereas int is a primitive data type defined in the Java language itself. Java does not automatically convert from one to the other. b) Integer can be used as an argument for a method that requires an object, whereas int can be used for calculations.
13.What is a cloneable interface and how many methods does it contain?
It is not having any method because it is a TAGGED or MARKER interface.
14.What is the difference between abstract class and interface?
a) All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract. b) In abstract class, key word abstract must be used for the methods whereas interface we need not use that keyword for the methods. c) Abstract class must have subclasses whereas interface can’t have subclasses.
15.Can you have an inner class inside a method and what variables can you access?
Yes, we can have an inner class inside a method and final variables can be accessed.
16.What is the difference between String and String Buffer?
a) String objects are constants and immutable whereas StringBuffer objects are not.
b) String class supports constant strings whereas StringBuffer class supports growable and modifiable strings.
Answer: write once ,run anywhere.
2. Name some of the classes which provide the functionality of collation?
Answer: collator, rulebased collator, collationkey, collationelement iterator.
3. Awt stands for? and what is it?
Answer: AWT stands for Abstract window tool kit. It is a is a package that provides an integrated set of classes to manage user interface components.
4. why a java program can not directly communicate with an ODBC driver?
Answer: Since ODBC API is written in C language and makes use of pointers which Java can not support.
5. Are servlets platform independent? If so Why? Also what is the most common application of servlets?
Answer: Yes, Because they are written in Java. The most common application of servlet is to access database and dynamically construct HTTP response
6.What modifiers may be used with top-level class?
public, abstract and final can be used for top-level class.
7.What are inner class and anonymous class?
Inner class : classes defined in other classes, including those defined in methods are called inner classes. An inner class can have any accessibility including private.
Anonymous class : Anonymous class is a class defined inside a method without a name and is instantiated and declared in the same place and cannot have explicit constructors.
8.What is a package?
A package is a collection of classes and interfaces that provides a high-level layer of access protection and name space management.
9.What is a reflection package?
java. lang. reflect package has the ability to analyze itself in runtime.
10.What is interface and its use?
Interface is similar to a class which may contain method’s signature only but not bodies and it is a formal set of method and constant declarations that must be defined by the class that implements it. Interfaces are useful for: a)Declaring methods that one or more classes are expected to implement b)Capturing similarities between unrelated classes without forcing a class relationship. c)Determining an object’s programming interface without revealing the actual body of the class.
11.What is an abstract class?
An abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete.
12.What is the difference between Integer and int?
a) Integer is a class defined in the java. lang package, whereas int is a primitive data type defined in the Java language itself. Java does not automatically convert from one to the other. b) Integer can be used as an argument for a method that requires an object, whereas int can be used for calculations.
13.What is a cloneable interface and how many methods does it contain?
It is not having any method because it is a TAGGED or MARKER interface.
14.What is the difference between abstract class and interface?
a) All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract. b) In abstract class, key word abstract must be used for the methods whereas interface we need not use that keyword for the methods. c) Abstract class must have subclasses whereas interface can’t have subclasses.
15.Can you have an inner class inside a method and what variables can you access?
Yes, we can have an inner class inside a method and final variables can be accessed.
16.What is the difference between String and String Buffer?
a) String objects are constants and immutable whereas StringBuffer objects are not.
b) String class supports constant strings whereas StringBuffer class supports growable and modifiable strings.
Subscribe to:
Posts (Atom)