Saturday, October 5, 2013

Java Interview Questions:

classloader -  ClassNotFoundException - ClassCastException - LinkageError
Many J2EE application servers have a hot deployment capability,
where we can reload an application with a new version of class
definition, without bringing the server VM down. Such application
servers make use of custom class loaders.

Dynamic Proxy - Reflection: (Spring AOP uses it extensively)

Singleton and Threads:

Java 7 Release Notes - Enhancements:

Whats New in Java EE 6:

web 2.0 vs web 3.0

servlet 2.5 vs 3.0

Async Servlet/Webservices:

Class Loading:

loose coupling and strong cohesion provides the best software

JSON - Jacson - Conversion:
Jersey framework uses Jackson or Jettison libraries for JSON unmarshalling/marshalling
Recommendation as far as I know is to use Jackson; Jettison support is older.

Web Services - Contract first or Code First:

Web service with Spring-WS and CXF:

JAX-RS implementations:


Apache cXF with Jettison or Jackson:
Spring Batch:

Enterprise Application Integration (EAI)
Enterprise Integration Patterns (EIP)
Enterprise Service Bus (ESB)

Integrating Flex and Spring based JMS applications

super() and this() in Constructor:

Why Method Overloading is not possible by changing the return type of method?

Covariant Return Types in Java 5

Runtime Polymorphism (upcasting - parent object created through child):

abstract and final in a method - not possible

static and abstract keywords can not be used together.

Marker Interface: (interface with no member methods - ex: Serializable)

Static Import in Java: (directly use static method without class qualifier)

superclass method does not declare an exception
 (checked exception can not be handled in childclass).

String immutable:

Immutable Class:

Accessing final local variable in local inner class:

Nested Interface:
Can a class have an interface?
Can an interface have a class?

calling run() method instead of start() method - no seperate call stack

Daemon Thread - give service to other running threads - background

static synchronization:


System.gc() - Daemon Thread - finalize keyword:

Runtime class in Java:

Runtime.getRuntime().exec("javac c:\java\ -d c:\java\")
Runtime.getRuntime().exec("java c:\java\abc")

Java Decompiler:


Odd, Even number generator threads:
Threads communicating through Pipes (PipedReader, PipedWriter):

queue is a First-In-First-Out (FIFO) - BlockingQueue:

ThreadLocal - Thread-Safe:

thread-safe singleton:
1. Use of synchronized block
2. eagar initialization vs lazy initialized when accessed
3. lazy initialization with static inner class

Thread Race Condition:

RESTful Client - FireFox - Poster (a SoapUI like tool)

AOP vs Dynamic Proxy:

Thread Dumps:

JMeter - BadBoy (Browser Recorder):

Simulate OutOfMemory: (use hashcode() or equals())

HTTP Session - forward, redirect and post-back:
Forward: browser not aware of it (no URL change) - No extra network trip
Redirect: browser reload to different URL (URL change occurs)

Client-pull or client-refresh (aka server polling):
You can use the tag for polling the server. This tag tells the client it must refresh the page after a number of seconds.

servlet clustering - memory replication of sessions

How do you send a file to a browser from your web application? I.e. how do you download a file from your web application?
response.setHeader(“Content-disposition”, “attachment;filename=” + fileName);


Sonal said...

Whatsapp status correspondences were not mixed, and data was sent and got in plaintext, significance messages could without quite a bit of a stretch be scrutinized if package takes after were available.

Sonal said...

Whatsapp locker script the application allows the user to set wallpaper and manage their profile picture. The user can also set your custom status message. Options such as set the font size for conversation, chat history and other support chat preferences can be set.Whatsapp locker script

Anna said...

Great and Useful Article.

Online Java Training

Online Java Course

Java EE course

Java Course in Chennai

Java Training in Chennai

Java Training Institutes in Chennai

Java Interview Questions

Java Interview Questions

Abderrahmen Ben Mariem said...

I suggest this core java tutorial which helped me to learn how to program in JAVA:

It helped me to learn polymorphism in java


Sid L said...

Awesome!! You got the best questions and answers for java interview. You're doing a great job.
Thanks for sharing.