Category Archives: Java

Java interview questions and answers

Describe what happens when an object is created in Java?
Several things happen in a particular order to ensure the object is constructed properly: 1. Memory is allocated from heap to hold all instance variables and implementation-specific data of the object and its superclasses. Implementation-specific data includes pointers to class and method [...]

Posted in Java | 2 Comments

Java threads question set

Do I need to use synchronized on setValue(int)? - It depends whether the method affects method local variables, class static or instance variables. If only method local variables are changed, the value is said to be confined by the method and is not prone to threading issues.
Do I need to use synchronized on setValue(int)? - [...]

Posted in Java | 2 Comments

30 simple Java questions

How could Java classes direct program messages to the system console, but error messages, say to a file?
The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be [...]

Posted in Java | 5 Comments

64 Java questions for any job interview

1. Which
of the following are valid definitions of an application’s main( ) method?
a) public static void main();
b) public static void main( String args );
c) public static void main( String args[] );
d) public static void main( Graphics g );
e) public static boolean main( String args[] );
2. If were compiled as an
application and then run from [...]

Posted in Java | 50 Comments

General Java Servlet questions

What is the servlet?
What are the JSP atrributes?
What is the need of super.init(config) in servlets?
How to know whether we have to use jsp or servlet in our project?
Can we call destroy() method on servlets from service method?
What is the Servlet Interface?

Also posted in Networking | 39 Comments

Newbie Java questions

If Runnable interface is better than Thread class, than why we are using Thread class? What is the need for Thread class?
Why we are calling System.gc() method to garbage collection of unused object, if garbage collection is automatically done in Java by daemon thread in background process with regular interval?
What is the significance of Marker [...]

Posted in Java | 59 Comments

Simple Java questions

Meaning - Abstract classes, abstract methods
Difference - Java,C++
Difference between == and equals method
Explain Java security model

Posted in Java | 67 Comments

Master list of Java interview questions - 115 questions

115 questions total, not for the weak. Covers everything from basics to JDBC connectivity, AWT and JSP.

What is the difference between procedural and object-oriented programs?- a) In procedural program, programming logic follows certain procedures and the instructions are executed one after another. In OOP program, unit of program is object, which is nothing but combination [...]

Posted in Java | 45 Comments

SAP/ABAP interview questions

Type of table?
Events of module pool?
Events of interactive report?

Also posted in Database, General, SAP ABAP | 10 Comments

Tough interview questions on EJB

How EJB Invocation happens? - Retrieve Home Object reference from Naming Service via JNDI. Return Home Object reference to the client. Create me a new EJB Object through Home Object interface. Create EJB Object from the Ejb Object. Return EJB Object reference to the client. Invoke business method using EJB Object reference. Delegate request to [...]

Also posted in Web dev | 3 Comments

EJB interview questions

What are the different kinds of enterprise beans? - Different kind of enterrise beans are Stateless session bean, Stateful session bean, Entity bean, Message-driven bean.
What is Session Bean? - A session bean is a non-persistent object that implements some business logic running on the server. One way to think of a session object.

Posted in Java | 9 Comments

ABAP interview questions and answers

Thanks to the reader who sent in this question set:

What is an ABAP data dictionary?- ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.
What are domains and data element?- Domains:Domain is the central object for describing [...]

Also posted in General, SAP ABAP | 58 Comments