Archive for java interview questions

You are browsing the archives of java interview questions.

Java Interview Questions and Answers

1. What is garbage collection? What is the process that is responsible for doing that in java? – 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? – It is a daemon thread. 3. What is a daemon thread? […]

Java Important Interview Questions

1. Java’s which system allows a thread to enter a synchronized method on an object, and then wait there until some other thread explicitly notifies it to come out Answer: Messaging 2. Packages act as containers for Answer: Classes, Subordinate packages 3. Threads priorities are not integers that specify the relative priority of one thread […]

Java-Fundamental concepts through OOPS

Q) OOPS concepts Polymorphism Ability to take more than one form, In java we achieve this using Method Overloading (compile time polymorphism), Method overriding (runtime polymorphism) Inheritance Is the process by which one object acquires the properties of another object. Encapsulation Wrapping of data and function into a single unit called encapsulation. Ex:- all java […]

c language technical/logical quetsions for freshers

21. What is the full form of CMM (a) Capability Maturity Model (b) Cost Maintainance Model (c) Capability maintainance model (d) Cost Maturity Model Ans:A 22. Sorting is not possible by using which of the following methods? (a) Insertion (b) Selection (c) Exchange (d) Deletion Ans:D 23. What are the methods available in storing sequential […]

Java- Advanced interview questions on JSP

1. What are the implicit objects? – Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are: request, response, pageContext, session, application, out, config, page, exception. 2. Is JSP technology extensible? – Yes. JSP technology is extensible through the development of […]

Java questions with one word answers

Q: What if the main method is declared as private? A: The program compiles properly but at runtime it will give “Main method not public.” message. Q: What if the static modifier is removed from the signature of the main method? A: Program compiles. But at runtime throws an error “NoSuchMethodError”. Q: What if I […]

Java- Technical question on Networking Concepts

1) The API doesn’t list any constructors for InetAddress- How do I create an InetAddress instance? ANSWER : In case of InetAddress the three methods getLocalHost, getByName, getByAllName can be used to create instances. E.g. InetAddress add1; InetAddress add2; try{ add1 = InetAddress.getByName(“java.sun.com”); add2 = InetAddress.getByName(“199.22.22.22”); }catch(UnknownHostException e){} 2) Is it possible to get the […]

Java- Technical questions on JDBC

1) What are the steps involved in establishing a connection? ANSWER : This involves two steps: (1) loading the driver and (2) making the connection. 2) How can you load the drivers? ANSWER : Loading the driver or drivers you want to use is very simple and involves just one line of code. If, for […]

Java-Programitical questions, logical questions,technical questions part-II

This paper gives an idea about Java programmatic questions and logicals that are being asked in interviews for freshers and experienced people. And also don’t forget to read another part of this series here, also check out complete Java section if you want to be master in Java Examine the following class definition: public class […]

Java-Programitical questions, logical questions,technical questions part-I

This paper gives an idea about java coding questions for freshers which are helpful for interview exams… What class must an inner class extend: 1) The top level class 2) The Object class 3) Any class or interface 4) It must extend an interface Answer 3 In the following code, which is the earliest statement, […]