Java Interview Useful Links

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 16

Java

====

Basic
-----

https://javarevisited.blogspot.com/2011/10/class-in-java-programming-general.html
https://javarevisited.blogspot.in/2011/12/main-public-static-java-void-method-
why.html

https://javarevisited.blogspot.com/2012/07/when-class-loading-initialization-java-
example.html

https://javarevisited.blogspot.in/2012/07/auto-boxing-and-unboxing-in-java-be.html
https://javarevisited.blogspot.in/2010/10/what-is-problem-while-using-in.html

http://www.java67.com/2016/08/difference-between-early-vs-late-binding-in-java.html
http://www.java67.com/2012/08/what-is-method-overloading-in-java-example.html
http://www.java67.com/2012/08/what-is-method-overriding-in-java-example-
tutorial.html
https://javarevisited.blogspot.com/2011/08/what-is-polymorphism-in-java-
example.html
https://javarevisited.blogspot.com/2011/12/method-overloading-vs-method-
overriding.html

https://javarevisited.blogspot.com/2012/10/what-is-inheritance-in-java-and-oops-
programming.html
https://javarevisited.blogspot.in/2011/07/why-multiple-inheritances-are-not.html

Collections
-----------

https://javarevisited.blogspot.in/2011/11/how-to-override-compareto-method-in.html

JVM
----

https://javarevisited.blogspot.com/2011/11/hotspot-jvm-options-java-examples.html

Keywords
--------

final, finally, finalize


http://www.java67.com/2016/06/difference-between-final-vs-finally-vs-finalize-in-
java.html
https://javarevisited.blogspot.in/2011/12/final-variable-method-class-java.html
http://www.java67.com/2017/07/can-you-make-abstract-class-method-final-in-java.html

static
https://javarevisited.blogspot.in/2011/11/static-keyword-method-variable-java.html
https://javarevisited.blogspot.com/2012/02/why-non-static-variable-cannot-be.html
https://javarevisited.blogspot.com/2012/03/mixing-static-and-non-static.html
http://www.java67.com/2012/08/can-we-overload-static-method-in-java.html

String
------
http://www.java67.com/2014/01/why-string-class-has-made-immutable-or-final-
java.html
https://javarevisited.blogspot.in/2011/07/string-vs-stringbuffer-vs-
stringbuilder.html
https://javarevisited.blogspot.com/2010/10/why-string-is-immutable-or-final-in-
java.html
https://www.java67.com/2014/01/why-string-class-has-made-immutable-or-final-
java.html
https://javarevisited.blogspot.com/2012/03/how-to-compare-two-string-in-java.html
https://www.java67.com/2014/08/difference-between-string-literal-and-new-String-
object-Java.html

Garbage Collection
------------------

https://javarevisited.blogspot.in/2011/04/garbage-collection-in-java.html

Mix
----

http://java67.blogspot.in/2012/09/top-10-tricky-java-interview-questions-
answers.html

Programs
========

http://www.java67.com/2012/11/how-to-read-file-in-java-using-scanner-example.html
http://www.java67.com/2016/06/how-to-count-number-of-words-in-given-String.html

https://javarevisited.blogspot.in/2011/09/variable-argument-in-java5-varargs.html
https://javarevisited.blogspot.in/2011/08/enum-in-java-example-tutorial.html
https://javarevisited.blogspot.in/2011/10/convert-double-to-string-example.html
https://javarevisited.blogspot.in/2011/08/convert-string-to-integer-to-string.html
https://javarevisited.blogspot.in/2011/04/garbage-collection-in-java.html
https://javarevisited.blogspot.in/2011/06/comparator-and-comparable-in-java.html
https://javarevisited.blogspot.in/2011/02/how-to-write-equals-method-in-java.html
https://javarevisited.blogspot.in/2014/03/binary-search-vs-contains-
performance.html

https://javarevisited.blogspot.in/2011/09/generics-java-example-tutorial.html

http://www.java67.com/2012/08/can-we-override-private-method-in-java.html

http://www.java67.com/2012/08/can-we-override-static-method-in-java.html

https://javarevisited.blogspot.in/2013/03/0-exception-handling-best-practices-in-
Java-Programming.html
https://javarevisited.blogspot.in/2013/12/when-to-make-method-final-in-java.html

https://javarevisited.blogspot.in/2015/10/133-java-interview-questions-answers-
from-last-5-years.html

https://javarevisited.blogspot.in/2012/01/tomcat-javalangoutofmemoryerror-
permgen.html

https://javarevisited.blogspot.in/2012/07/when-class-loading-initialization-java-
example.html

https://javarevisited.blogspot.in/2010/10/abstraction-in-java.html

https://javarevisited.blogspot.in/2011/12/checked-vs-unchecked-exception-in-
java.html

https://javarevisited.blogspot.in/2012/01/how-to-write-thread-safe-code-in-
java.html

https://javarevisited.blogspot.in/2011/04/top-20-core-java-interview-questions.html

https://javarevisited.blogspot.in/2012/01/find-max-free-total-memory-in-java.html

http://java.about.com/od/a/g/association.htm
https://javarevisited.blogspot.com/2014/02/ifference-between-association-vs-
composition-vs-aggregation.html
http://programmers.stackexchange.com/questions/202378/when-to-use-inheritance-or-
composition-aggregation

http://stackoverflow.com/questions/269496/inheritance-vs-aggregation

http://sakthimaharai.hubpages.com/hub/why-do-we-need-abstract-classes-and-
interfaces-in-java-and-what-is-the-use-of-abstract-classes-and-interfaces

http://www.programmerinterview.com/index.php/java-questions/interface-vs-abstract-
class/

http://edn.embarcadero.com/article/30372

http://javaeasy.weebly.com/types-of-coupling.html

http://stackoverflow.com/questions/14228520/why-is-method-overloading-and-
overriding-needed-in-java
http://www.javatpoint.com/abstract-class-in-java

http://javarevisited.blogspot.in/2012/03/what-is-encapsulation-in-java-and-
oops.html
http://r4r.co.in/answer.php?id=1585&option=java%20Subjective

http://www.javacoffeebreak.com/faq/faq0084.html

http://stackoverflow.com/questions/6856133/why-use-an-abstract-class-without-
abstract-methods

http://stackoverflow.com/questions/3394445/abstract-class-cant-be-instantiated-but-
can-have-constructor-little-confusing

http://www.javaken.com/forum/showthread.php?t=3014

http://www.pixelstech.net/article/index.php?id=1366044255

http://geekexplains.blogspot.in/2008/06/can-you-override-static-methods-in-
java.html

http://stackoverflow.com/questions/13447878/java-non-static-to-static-method-
hiding-or-overriding

http://stackoverflow.com/questions/7081742/is-inherited-the-correct-term-to-
explain-static-method-of-superclass-can-be-ac

http://stackoverflow.com/questions/10501503/java-field-hiding

http://www.javabeginner.com/learn-java/java-constructors

http://javarevisited.blogspot.sg/2011/12/main-public-static-java-void-method-
why.html
https://javarevisited.blogspot.in/2011/06/noclassdeffounderror-exception-in.html
https://javarevisited.blogspot.in/2011/07/classnotfoundexception-vs.html
https://javarevisited.blogspot.com/2011/08/classnotfoundexception-in-java-
example.html

http://www.java67.com/2013/03/how-to-split-string-in-java-regular-expression.html
http://www.java67.com/2016/10/difference-between-heap-and-stack-memory-in-java-
JVM.html
http://www.java67.com/2013/08/guide-of-javalangoutofmemoryerror-java-heap-space-
tomcat-eclipse-minecraft-jboss.html
https://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html
Constructors
------------

https://www.geeksforgeeks.org/constructors-in-java/
https://www.geeksforgeeks.org/g-fact-50/
https://www.geeksforgeeks.org/g-fact-55/
https://www.geeksforgeeks.org/copy-constructor-in-java/
https://www.geeksforgeeks.org/constructor-chaining-java-examples/
https://www.geeksforgeeks.org/private-constructors-and-singleton-classes-in-java/
https://www.geeksforgeeks.org/java-interview-questions-constructors/
https://www.geeksforgeeks.org/java-gq/constructors-2-gq/
https://www.geeksforgeeks.org/constructor-overloading-java/
https://www.geeksforgeeks.org/singleton-class-java/
https://www.geeksforgeeks.org/output-java-programs-set-14-constructors/
http://stackoverflow.com/questions/3394445/abstract-class-cant-be-instantiated-but-
can-have-constructor-little-confusing
https://stackoverflow.com/questions/3164270/what-use-are-constructors-in-abstract-
classes
https://stackoverflow.com/questions/2170500/why-do-abstract-classes-in-java-have-
constructors
https://www.geeksforgeeks.org/constructors-not-inherited-java
https://www.geeksforgeeks.org/order-execution-initialization-blocks-constructors-
java

Optional
--------
https://javarevisited.blogspot.com/2017/04/10-examples-of-optional-in-java-8.html

2.Collection Framework
=============================
http://www.java67.com/2012/08/how-to-create-read-only-collection-in-java-
example.html#at_pco=smlwn-1.0&at_si=5b02905a4101f0f2&at_ab=per-2&at_pos=0&at_tot=1
https://javarevisited.blogspot.in/2011/05/example-of-arraylist-in-java-
tutorial.html
https://javarevisited.blogspot.in/2011/10/java-iterator-tutorial-example-list.html
https://javarevisited.blogspot.in/2012/02/fail-safe-vs-fail-fast-iterator-in-
java.html
https://javarevisited.blogspot.in/2011/09/difference-vector-vs-arraylist-in-
java.html
https://javarevisited.blogspot.in/2012/04/difference-between-list-and-set-in-
java.html
https://javarevisited.blogspot.in/2011/09/difference-hashmap-vs-hashset-java.html
https://javarevisited.blogspot.in/2012/01/java-hashtable-example-tutorial-code.html
https://javarevisited.blogspot.in/2011/04/difference-between-concurrenthashmap.html
https://javarevisited.blogspot.in/2013/02/concurrenthashmap-in-java-example-
tutorial-working.html
https://javarevisited.blogspot.in/2012/01/convert-arraylist-to-set-java-
example.html
https://javarevisited.blogspot.in/2012/01/how-to-sort-arraylist-in-java-
example.html
https://javarevisited.blogspot.in/2012/03/how-to-loop-arraylist-in-java-code.html
http://www.java67.com/2014/12/how-to-synchronize-arraylist-in-java.html
https://javarevisited.blogspot.in/2011/06/converting-array-to-arraylist-in-
java.html
http://www.java67.com/2014/03/2-ways-to-remove-elementsobjects-from-ArrayList-
java.html
https://javarevisited.blogspot.in/2012/02/difference-between-linkedlist-vs.html
https://javarevisited.blogspot.in/2010/10/what-is-difference-between-
enumeration.html
http://www.java67.com/2012/11/difference-between-operator-and-equals-method-in.html
http://www.java67.com/2012/08/5-difference-between-hashtable-hashmap-Java-
collection.html
http://www.java67.com/2013/02/10-examples-of-hashmap-in-java-programming-
tutorial.html
http://www.java67.com/2013/04/example-of-overriding-equals-hashcode-compareTo-java-
method.html
http://www.java67.com/2013/06/how-get-method-of-hashmap-or-hashtable-works-
internally.html
https://javarevisited.blogspot.in/2011/02/how-hashmap-works-in-java.html
http://cleanjava.wordpress.com/tag/hashset/
http://www.coderanch.com/t/510081/java-programmer-SCJP/certification/TreeSet-
adding-null
http://geeks.prismazure.com/2012/07/java-concurrenthashmap-collections-
synchronizedmap/ (good)
http://java-questions.com/collections-interview-questions.html
http://java2novice.com/java_interview_questions/fail-fast/
http://howtodoinjava.com/2012/10/21/when-to-use-comparable-and-comparator-
interfaces-in-java/
http://stackoverflow.com/questions/510632/whats-the-difference-between-
concurrenthashmap-and-collections-synchronizedmap (good)
https://forums.oracle.com/thread/2078227
http://howtodoinjava.com/2013/05/27/best-practices-for-using-concurrenthashmap/
(good)
http://howtodoinjava.com/2013/05/02/how-to-design-a-good-key-for-hashmap/
http://javarevisited.blogspot.in/2013/02/concurrenthashmap-in-java-example-
tutorial-working.html(good)
http://howtodoinjava.com/2013/06/14/popular-hashmap-and-concurrenthashmap-
interview-questions/
http://stackoverflow.com/questions/16105554/concurrenthashmap-read-and-write-lock
http://stas-blogspot.blogspot.in/2010/08/concurrenthashmap-revealed.html
http://stackoverflow.com/questions/16600019/creating-a-concurrenthashmap-that-
supports-snapshots
http://stackoverflow.com/questions/507602/how-to-initialise-a-static-map-in-java
http://java2novice.com/java-interview-programs/arraylist-implementation/
http://way2java.com/collections/map/sortedmap/treemap/hashmap-vs-treemap/
http://stackoverflow.com/questions/490557/what-basic-operations-on-a-map-are-
permitted-while-iterating-over-it
http://javabeanz.wordpress.com/2007/07/13/treemap-vs-hashmap/
http://stackoverflow.com/questions/3467965/how-does-arraylist-work
http://stackoverflow.com/questions/2836267/concurrenthashmap-in-java
http://crackingjavainterviews.blogspot.in/2013/04/discuss-internals-of-concurrent-
hashmap.html
http://stackoverflow.com/questions/14947723/is-concurrenthashmap-totally-safe(good)
http://stackoverflow.com/questions/14242899/java-hashmap-collision
http://www.javaworld.com/article/2075249/java-se/secure-type-safe-collections.html
http://javarevisited.blogspot.in/2011/02/how-hashmap-works-in-java.html
http://www.tutorialsavvy.com/2012/12/capacity-load-factor-hashmap.html
http://prasanta-paul.blogspot.in/2010/06/hashmap-internal.html
http://mkbansal.wordpress.com/2010/06/24/hashmap-how-it-works/
http://tekmarathon.wordpress.com/2012/12/04/hashmap-internal-implementation-
analysis-in-java/

Note=Another difference is that ConcurrentHashMap does not throw


ConcurrentModificationException if the ConcurrentHashMap is changed while being
iterated.
The Iterator is not designed to be used by more than one thread though whereas
synchronizedMap may throw ConcurrentModificationException

3.Multi Threading
=================
https://www.java67.com/2012/08/difference-between-countdownlatch-and-cyclicbarrier-
java.html
http://javarevisited.blogspot.sg/2010/10/what-is-deadlock-in-java-how-to-fix-
it.html
http://www.fromdev.com/2008/05/java-threading-questions.html
https://javarevisited.blogspot.in/2012/03/mixing-static-and-non-static.html
https://javarevisited.blogspot.in/2012/03/difference-between-start-and-run-
method.html
http://javarevisited.blogspot.in/2011/04/synchronization-in-java-synchronized.html
http://www.javaspecialists.eu/archive/Issue056.html
http://java.dzone.com/articles/java-volatile-keyword-0
http://www.programmerinterview.com/index.php/operating-systems/example-of-
threading-and-synchronization-2/
http://tutorials.jenkov.com/java-concurrency/race-conditions-and-critical-
sections.html
http://www.javabeat.net/2009/02/volatile-keyword-in-java/
http://www.javacodegeeks.com/2013/01/java-thread-pool-example-using-executors-and-
threadpoolexecutor.html
http://www.dailyfreecode.com/Code/volatile-variable-1409.aspx
http://java67.blogspot.in/2013/03/difference-between-wait-vs-notify-vs-notifyAll-
java-thread.html
http://javarevisited.blogspot.sg/2011/05/wait-notify-and-notifyall-in-java.html
http://stackoverflow.com/questions/9382015/can-two-threads-access-a-synchronized-
method-at-the-same-time
http://www.programmerinterview.com/index.php/java-questions/how-to-create-a-thread/
http://java67.blogspot.sg/2013/01/difference-between-callable-and-runnable-
java.html
http://javarevisited.blogspot.sg/2012/03/difference-between-start-and-run-
method.html
http://stackoverflow.com/questions/7416018/when-does-the-main-thread-stop-in-java
http://java2all.com/1/1/17/93/technology/core-java/multithreading/the-main-thread
http://howtodoinjava.com/2013/03/08/difference-between-sleep-and-wait/
http://stackoverflow.com/questions/3590000/what-does-java-lang-thread-interrupt-do
http://www.javatpoint.com/interrupting-a-thread
http://stackoverflow.com/questions/17748078/simplest-and-understandable-example-of-
volatile-keyword-in-java
http://www.java-redefined.com/p/java-thread-with-callable-interface.html
http://www.java67.com/2012/08/difference-between-countdownlatch-and-cyclicbarrier-
java.html

https://javarevisited.blogspot.in/2010/10/what-is-deadlock-in-java-how-to-fix-
it.html

Advance Multithreading
========================
http://javabeanz.wordpress.com/2007/07/12/using-reentrant-locks-for-thread-
synchronization/
http://www.ibm.com/developerworks/library/j-jtp10264/
http://docs.oracle.com/javase/tutorial/essential/concurrency/starvelive.html
http://stackoverflow.com/questions/62814/difference-between-binary-semaphore-and-
mutex
http://www.programmerinterview.com/index.php/operating-systems/monitors-vs-
semaphores/
http://stackoverflow.com/questions/771347/what-is-mutex-and-semaphore-in-java-what-
is-the-main-difference
http://javarevisited.blogspot.in/2012/05/counting-semaphore-example-in-java-5.html
http://javapapers.com/core-java/semaphores-using-java/
http://www.javajee.com/semaphore-in-java-with-example
http://www.concretepage.com/java/reentrantlock_java

4.Singleton
====================
https://www.journaldev.com/1377/java-singleton-design-pattern-best-practices-
examples
http://javarevisited.blogspot.in/2011/03/10-interview-questions-on-singleton.html
http://java-sample-program.blogspot.in/2012/11/singleton-interview-questions.html
http://javapapers.com/design-patterns/singleton-pattern/
https://javarevisited.blogspot.in/2012/07/why-enum-singleton-are-better-in-
java.html
https://javarevisited.blogspot.in/2013/03/difference-between-singleton-pattern-vs-
static-class-java.html
https://javarevisited.blogspot.in/2011/03/10-interview-questions-on-singleton.html

5.Exception Handling
============================

https://howtodoinjava.com/java/exception-handling/how-to-effectively-handle-
nullpointerexception-in-java/
https://howtodoinjava.com/java/exception-handling/checked-exceptions-thrown-in-
initializer-blocks-can-be-declared-by-the-constructors/

http://www.java67.com/2012/12/difference-between-runtimeexception-and-checked-
exception.html
http://javarevisited.blogspot.in/2013/06/10-java-exception-and-error-interview-
questions-answers-programming.html
http://www.tutorialspoint.com/listtutorial/How-to-fix-ClassNotFoundException-in-
Java/3701
http://javarevisited.blogspot.in/2011/06/noclassdeffounderror-exception-in.html
http://www.javatpoint.com/throws-keyword-and-difference-between-throw-and-throws
http://www.javaroots.com/2013/02/classnotfoundexception-vs.html
http://www.akadia.com/services/java_exceptions.html
http://www.javamex.com/tutorials/exceptions/exceptions_finally.shtml
http://examples.javacodegeeks.com/java-basics/exceptions/create-custom-exception-
example/
http://www.coderanch.com/t/504116/java/java/custom-exceptions
http://www.avajava.com/tutorials/lessons/how-do-i-chain-exceptions.html
http://stackoverflow.com/questions/214741/what-is-a-stack-overflow-error
http://stackoverflow.com/questions/17709223/throwing-exceptions-from-constructor-
is-it-necessary-subclass-has-to-throw-as
http://stackoverflow.com/questions/9814283/need-to-create-a-new-runtimeexception-
for-emptystacks
http://stackoverflow.com/questions/8177487/when-to-use-user-defined-class-which-
extends-runtimeexception
http://stackoverflow.com/questions/5126455/in-java-what-if-both-try-and-catch-
throw-same-exception-and-finally-has-a-return
http://www.akgupta.com/Java/Notes/section2-3.htm
http://mottishaked.com/training/dot-net-tutorial/181/exceptions-and-error-
handling/the-finally-block
http://stackoverflow.com/questions/1692230/is-it-possible-to-catch-out-of-memory-
exception-in-java

6.String & Immutable


============================
http://codeofdoom.com/wordpress/2009/02/24/learn-this-when-and-how-to-make-
immutable-objects/
http://javapapers.com/core-java/java-string/
http://javarevisited.blogspot.in/2010/10/why-string-is-immutable-in-java.html
http://stackoverflow.com/questions/2012305/comparing-stringbuffer-content-with-
equals

Note :StringBuilder class has been added in Java 5 and provided similar
functionality of StringBuffer (ie.. mutable string ) where on every modification on
string , no new object gets created now benefit of using StringBuilder is that its
comparatively faster than StringBuffer because StringBuffer is a
synchronized class while StringBuilder is not , so in case if you want to use
StringBuffer in a environment where thread safety is not concern ,
consider using StringBuilder for better performance.

Equals && hashcode


=========================
http://www.javaworld.com/community/node/1006
http://manikandanmv.wordpress.com/tag/equals-and-hashcode-example-in-java/
http://shivasoft.in/blog/java/what-is-the-need-to-override-hashcode-and-equals-
method/
http://eclipsesource.com/blogs/2012/09/04/the-3-things-you-should-know-about-
hashcode/
http://www.coderanch.com/t/501225/java/java/hashcode-String-Class-Object

8.Serialization
=================
http://javapapers.com/core-java/java-serialization/
http://www.fromdev.com/2012/06/15-java-serialization-interview.html
http://javapapers.com/core-java/customize-default-serialization-protocol/
http://javapapers.com/core-java/serialversionuid-in-java-serialization/#&slider1=1
http://javarevisited.blogspot.com/2011/04/top-10-java-serialization-interview.html
http://www.byteslounge.com/tutorials/java-custom-serialization-example
http://geekexplains.blogspot.in/2009/10/marker-interface-in-java-what-why-uses.html

Question-My subclass implements Serializable but my superclass doesn't. Both


subclass and superclass contain instance variables that need to be saved as
part of the state of the subclass. Will serialization save the superclass fields
for me?

Answer

When you serialize an object, the serialization mechanism works by chaining up the
inheritence hierarchy, saving the sate of each Serializable superclass in
turn. When serialization reaches the first non-serializable superclass, the
serialization stops.

When deserializing, the state of this first non-serializable superclass is restored


not from the stream, but by invoking that class' no-argument constructor.
If the no-argument constructor is not adequate for your purposes, you must
customize the serialization of your subclass with writeObject() and readObject()
in order to write out and restore any information from the non-serializable
superclass that you find necessary.

Question- if the superclass class implements Serializable, does the subclass need
to implement Serializable as well?
Answer-No, if the superclass implements java.io.Serializable,that covers all
subclasses.
However, it is still possible for a subclass object instance to be unserializable
at runtime! So you need to be careful. Some people even mark their
serializable classes as final to prevent potential problems.

9.Wrapper Class
=======================
http://stackoverflow.com/questions/13339918/what-is-the-main-difference-between-
primitive-type-and-wrapper-class
http://www.coderanch.com/t/503575/java-programmer-SCJP/certification/Wrapper-
classes-immutable
http://stackoverflow.com/questions/4117793/are-java-wrapper-classes-really-
immutable

10.Others
===========
http://stackoverflow.com/questions/2420389/static-initialization-blocks
http://java2novice.com/java-interview-programs/
http://www.programmerinterview.com/index.php/java-questions/how-system-out-println-
works/

11.JAVA BASICS & JDK1.5 Features


========================================
http://www.concretestudy.com/corejava/jdk1.5_newFeature_lang.php
http://www.techrepublic.com/article/java-programming-explore-the-advanced-coding-
features-of-jdk-15/5147404
http://www.visualbuilder.com/java/jdk15/tutorial/annotations-(metadata)/
http://howtodoinjava.com/2012/11/02/a-mini-guide-to-main-method-in-java/
http://www.java-forums.org/new-java/12205-why-main-java-declared-public-static-
void-main.html
http://playjava.wordpress.com/question-and-answers/explain-public-static-void-main-
string-args/
http://www.javatpoint.com/difference-between-jdk-jre-and-jvm
http://www.programmerinterview.com/index.php/java-questions/jvm-platform-dependent/
http://www.techartifact.com/blogs/2009/07/intoduction-jar-ear-war-java.html
http://viralpatel.net/blogs/java-virtual-machine-an-inside-story/
http://javapapers.com/core-java/java-features-and-history/
http://www.ntu.edu.sg/home/ehchua/programming/java/JDK7_NewFeatures.html
http://javarevisited.blogspot.in/2012/07/when-class-loading-initialization-java-
example.html
http://www.programcreek.com/2013/01/when-and-how-a-java-class-is-loaded-and-
initialized/
http://stackoverflow.com/questions/4343760/when-is-static-variable-loaded-in-java-
runtime-or-compile-time
http://www.xyzws.com/Javafaq/what-does-classforname-method-do/17
http://stackoverflow.com/questions/9082971/compile-time-constants-and-variables

12.Finalize
==================
http://howtodoinjava.com/2012/10/31/why-not-to-use-finalize-method-in-java/
http://www.ashishsharma.me/2011/08/java-garbage-collection-notes.html
http://msdn.microsoft.com/en-us/magazine/bb985010.aspx
http://javarevisited.blogspot.in/2011/04/garbage-collection-in-java.html
http://stackoverflow.com/questions/28832/java-and-manually-executing-finalize
http://www.javaworld.com/javaworld/jw-08-1996/jw-08-gc.html?page=1

13.OutOfMemory
======================
http://javarevisited.blogspot.in/2011/09/javalangoutofmemoryerror-permgen-
space.html
http://plumbr.eu/blog/what-is-a-memory-leak
http://www.vogella.com/articles/JavaPerformance/article.html
http://javarevisited.blogspot.in/2011/05/java-heap-space-memory-size-jvm.html

14.Enum
==============
http://javarevisited.blogspot.in/2011/08/enum-in-java-example-tutorial.html
Enums are basically classes. They can implement interfaces, have behaviour and so
on.

15.JDBC
===============
http://java67.blogspot.in/2012/12/jdbc-interview-questions-answers-in-Java-2-4-
years-experienced.html
http://www.techinterviews.com/jdbc-interview-questions-and-answers
http://www.javapractices.com/topic/TopicAction.do?Id=127
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frzaha
%2Fcallable.htm
http://stackoverflow.com/questions/15198319/why-do-we-use-a-datasource-instead-of-
a-drivermanager
http://www.jdbc-tutorial.com/jdbc-driver-types.htm
http://www.techfaq360.com/JDBC_interview_questions.jsp?qid=438
http://www.coderanch.com/t/296325/JDBC/databases/DriverManager-DataSource
http://www.java-forums.org/blogs/jdbc/1413-advantages-datasource-objects.html
http://stackoverflow.com/questions/9001166/how-to-create-a-datasource-in-jboss-
application-server
http://docs.oracle.com/cd/E11882_01/java.112/e12265/intro.htm
http://webmoli.com/2008/10/23/back-to-basics-statement-vs-prepared-statement/
http://javabeginnerstutorial.com/oracle/jdbc-statement-vs-preparedstatement-vs-
callablestatement/

Database
================
http://www.programmerinterview.com/index.php/database-sql/what-is-an-index/
http://www.programmerinterview.com/index.php/database-sql/selectivity-in-sql-
databases/
http://www.synametrics.com/SynametricsWebApp/WPTop10Tips.jsp
http://dba.stackexchange.com/questions/17830/will-more-indexes-on-a-table-affect-
performanceS
http://www.lornajane.net/posts/2012/sql-joining-a-table-to-itself
http://www.dwbiconcepts.com/tutorial/24-interview-questions/190-top-20-sql-
interview-questions-with-answers.html
http://www.indiabix.com/technical/sql-server-common-questions/
http://www.tutorialspoint.com/sql/sql-having-clause.htm
http://www.w3schools.com/sql/sql_top.asp
http://www.techonthenet.com/oracle/questions/bottom_records.php
http://www.programmerinterview.com/index.php/database-sql/clustered-vs-non-
clustered-index/
http://javarevisited.blogspot.in/2013/08/difference-between-clustered-index-and-
nonclustered-index-sql-server-database.html
http://technet.microsoft.com/en-us/library/aa933130(v=sql.80).aspx
http://stackoverflow.com/questions/1278521/why-do-you-create-a-view-in-a-database
http://www.tutorialspoint.com/jdbc/jdbc-transactions.htm
http://www.tutorialspoint.com/jdbc/commit-rollback.htm
http://www.tutorialspoint.com/jdbc/jdbc-savepoints.htm
http://www.careerbless.com/db/rdbms/c1/design.php
http://www.dotnet-tricks.com/Tutorial/sqlserver/bM6H260812-Tips-to-improve-SQL-
Server-database-design-and-performance.html
http://stackoverflow.com/questions/3386217/is-there-an-equivalent-to-sql-servers-
set-nocount-in-mysql
1.employee table and department table.get department name having more than 10
employee
mysql> select d.deptname from department d inner join (select deptid from employee
group by deptid having count(deptid)>=10) d1 on d.deptid =d1.deptid;
or
select deptname from department where deptid=(select deptid from (select
deptid,count(deptid)cdeptid from employee having max(cdeptid)) temp);
2.student and marks table.find student name with maximum marks
mysql> select s.rollno,s.name from student s inner join (select rollno from marks
where marks=(select max(marks) from marks)) m on s.rollno = m.rollno;
3.library table,columns user and bookname.find which book is most read by the
users.
mysql> select bookname,count(bookname) totalreaders from library where user is not
null group by bookname;
4.create table2 like table1;
insert table2 select * from table1
5.last 5 records
select * from (select * from employee order by empid desc) temp limit 5

delimiter $$;
create procedure empsalary(IN emp_id int,IN name varchar(30),IN salary int)
BEGIN
insert into salary value (emp_id,name,salary);
select count(*) from salary;
END;
$$;

call empsalary(6,'Kapil',200);

SAX vs DOM
==================
http://idiotechie.com/sax-vs-dom-parser/

Spring Questions
========================
Spring-Core
http://javafaq.wordpress.com/spring-interview-questions/
http://www.javabeat.net/2009/02/spring-framework-interview-questions/
http://javainterview.co.in/interview/spring-interview-question.html
http://www.javatpoint.com/spring-aop-tutorial
http://www.javabeat.net/2007/07/introduction-to-springs-aspect-oriented-
programmingaop/
http://www.coderanch.com/t/547943/Spring/Spring-loads-spring-configuration-files
http://stackoverflow.com/questions/11547240/spring-creating-multiple-instances-of-
a-singleton
http://stackoverflow.com/questions/7451325/spring-mvc-what-are-a-context-and-
namespace/7451389#7451389
http://stackoverflow.com/questions/7774295/spring-xml-file-configuration-hierarchy-
help-explanation/7774597#7774597
http://stackoverflow.com/questions/7746633/declaring-spring-bean-in-parent-context-
vs-child-context/7748108#7748108
http://stackoverflow.com/questions/11708967/what-is-the-difference-between-
applicationcontext-and-webapplicationcontext-in-s
http://stackoverflow.com/questions/3652090/difference-between-applicationcontext-
xml-and-spring-servlet-xml-in-spring
http://schoudari.wordpress.com/2012/07/23/purpose-of-contextloaderlistener-spring-
mvc/
http://docs.spring.io/spring/docs/3.0.0.M3/reference/html/ch16s02.html
http://www.javabeat.net/2013/03/spring-bean-scopes-singleton-prototype/#
http://java.dzone.com/articles/method-injection-spring
http://www.mkyong.com/spring/spring-bean-scopes-examples/
http://javapapers.com/spring/spring-annotation-based-controllers/
http://www.javatpoint.com/spring-tutorial
http://javarevisited.blogspot.in/2011/09/spring-interview-questions-answers-
j2ee.html`
http://docs.spring.io/spring/docs/3.0.0.M3/reference/html/ch04s04.html#beans-
factory-scopes-singleton
http://thecafetechno.com/tutorials/spring/lookup-getter-method-injection-example/
http://www.javabeat.net/2008/07/how-to-lazy-initialize-spring-beans/
http://www.java4s.com/spring/difference-between-setter-injection-and-constructor-
injection/
http://www.mkyong.com/spring/spring-loosely-coupled-example/
http://orangeslate.com/2006/11/10/12-benefits-of-spring-mvc-over-struts/
Related-Autowire
http://howtodoinjava.com/2013/05/08/spring-beans-autowiring-concepts/
http://www.mkyong.com/spring/spring-autowiring-by-name/
http://www.mkyong.com/spring/spring-autowiring-by-type/
http://www.mkyong.com/spring/spring-autowiring-by-constructor/
http://www.mkyong.com/spring/spring-autowiring-by-autodetect/
Related-Spring MVC
http://www.mkyong.com/spring-mvc/spring-mvc-hello-world-example/
http://www.dzone.com/tutorials/java/spring/spring-multi-action-controller.html
http://kruders.com/spring-mvc/configure-multiple-handler-mappings-in-spring-mvc/
http://www.dineshonjava.com/2012/12/spring-mvc-with-hibernate-crud-
example.html#.UkxAIYbrz8Y
http://viralpatel.net/blogs/tutorial-save-get-blob-object-spring-3-mvc-hibernate/
http://www.javabeat.net/extending-viewresolver-and-chaining-viewresolvers-in-
spring-mvc/
http://programmers.stackexchange.com/questions/162399/how-essential-is-it-to-make-
a-service-layer
http://stackoverflow.com/questions/1099025/spring-transactional-what-happens-in-
background
http://stackoverflow.com/questions/15300483/some-clarification-about-spring-
transactional-annotation-on-a-method

Hibernate
========================
http://www.tutorialspoint.com/hibernate/index.htm
http://www.java4s.com/hibernate/life-cycle-of-pojo-class-objects-in-the-hibernate/
http://www.javalobby.org/java/forums/t104442.html
http://www.javabeat.net/articles/37-introduction-to-hibernate-caching-1.html
http://shivasoft.in/blog/java/hibernate/cause-and-solution-of-org-hibernate-
lazyinitializationexception-could-not-initialize-proxy-no-session-error/
http://www.techfaq360.com/hibernate_interview_questions.jsp?qid=241
http://www.java4s.com/hibernate/hibernate-cascade-options-cascade-attribute-in-
hibernate/
http://www.java4s.com/hibernate/difference-between-merge-and-update-methods-in-
hibernate/
http://www.mkyong.com/hibernate/inverse-true-example-and-explanation/
http://www.javabeat.net/configuring-multiple-databases-in-hibernate/
http://www.mkyong.com/hibernate/different-between-session-get-and-session-load/
http://www.intertech.com/Blog/hibernate-load-and-get/
http://www.java4s.com/hibernate/hibernate-first-level-cache-example/
http://www.java4s.com/hibernate/hibernate-second-level-cache-example/
http://stackoverflow.com/questions/4130840/can-i-have-two-databases-related-
session-factory-tags-in-a-single-hibernate-cfg
http://www.tutorialspoint.com/hibernate/hibernate_batch_processing.htm
http://viralpatel.net/blogs/tutorial-save-get-blob-object-spring-3-mvc-hibernate/
http://www.tutorialspoint.com/hibernate/hibernate_batch_processing.htm
http://www.tutorialspoint.com/hibernate/hibernate_query_language.htm
http://www.java4s.com/hibernate/part-4-hibernate-query-language-using-hql-select-
query/
http://www.javatpoint.com/hibernate-named-query
http://stackoverflow.com/questions/15596025/hibernate-named-queries-and-its-
performance-advantage
http://stackoverflow.com/questions/7769447/advantages-of-named-queries-in-hibernate
http://breezegallery.blogspot.in/2009/07/problem-description-when-designing-
code.html
http://www.java4s.com/hibernate/hibernate-hello-world-program-with-annotations/
http://www.javaworkspace.com/hibernate/firstHibernateProgram.do
http://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-
and-what-they-do
http://stackoverflow.com/questions/6687422/hibernate-batch-size-confusion
http://java.dzone.com/articles/hibernate-performance-tuning
http://www.javatpoint.com/hibernate-and-spring-integration
http://hibernatespring.blogspot.in/2011/07/difference-between-criteria-and.html
http://java.dzone.com/articles/hibernate-example-part-2
http://lifeinide.blogspot.in/2010/11/hibernate-parent-child-and-annotations.html
http://learningviacode.blogspot.in/2012/02/automatic-dirty-checking.html
Note:
1.A Session instance is serializable if its persistent classes are serializable.
2.It is not intended that implementors be threadsafe. Instead each
thread/transaction should obtain its own instance from a SessionFactory.
3.The difference between flush and commit are :
- Commit will make the database commit
- Flushing is the process of synchronizing the underlying persistent
store with persistable state held in memory.
ie. it will update or insert into your tables in the running
transaction, but it _may_ not commit those changes (this depends on
your flush mode). When you have a persisted object and you change a
value on it, it becomes dirty and hibernate needs to flush these
changes to your persistence layer. It may do this automatically for
you or you may need to do this manually, that depends on your flush
mode,

Servlet & JSP


===============
http://www.xyzws.com/Servletfaq/when-is-destroy-of-servlets-called/20
http://www.javatpoint.com/Servlet-interface
http://www.javatpoint.com/HttpSessionEvent
http://www.javatpoint.com/jsp-tutorial
http://srikanthtechnologies.com/articles/j2ee/filters.html
http://nic.jlu.edu.cn/newcourse/dbxz/jspbasics.pdf
http://theopentutorials.com/examples/java-ee/jsp/pagination-in-servlet-and-jsp/
http://stackoverflow.com/questions/7701772/how-does-multithreading-work-for-a-java-
servlet
http://www.javaworld.com/javaworld/jw-07-2004/jw-0712-threadsafe.html?page=5
http://tutorials.jenkov.com/java-servlets/servlet-concurrency.html
http://docs.oracle.com/javaee/1.4/api/javax/servlet/SingleThreadModel.html
http://www.coderanch.com/t/598656/Servlets/java/servlet-container-infinite-
instances-servlet
http://stackoverflow.com/questions/7803339/why-we-write-load-on-startup2-load-on-
startup-in-web-xml-while-using-struts
http://stackoverflow.com/questions/809775/what-does-the-servlet-load-on-startup-
value-of-0-zero-signify?rq=1
http://www.coderanch.com/t/465935/Servlets/java/load-startup
http://javapapers.com/servlet/what-is-preinitialization-of-a-java-servlet/
http://www.xyzws.com/Servletfaq/what-is-the-difference-between-the-request-
attribute-and-request-parameter/1
http://stackoverflow.com/questions/16745857/can-we-call-service-method-from-
destroy-method-in-servlet
http://javapapers.com/servlet/what-happens-if-you-call-destroy-from-init-in-java-
servlet/
http://www.coderanch.com/t/425606/Servlets/java/servlet-destroy-method-called
http://www.coderanch.com/t/462078/Struts/Difference-Request-scope-Session-scope
http://tutorials.jenkov.com/java-servlets/web-xml.html
http://stackoverflow.com/questions/18996025/when-container-call-deployment-
descriptor-web-xml
http://www.apekshit.com/t/426/JSP-Request-Scope-Example
http://stackoverflow.com/questions/5649722/how-to-call-servlet-through-a-jsp-page

Struts
==========
http://struts.apache.org/release/1.2.x/faqs/database.html
http://www.braindelay.com/danielbray/struts-top-tips/stt.html
http://www.java-samples.com/showtutorial.php?tutorialid=582
http://www.mkyong.com/struts/struts-multiple-configuration-files-example/
http://www.dzone.com/tutorials/java/struts/struts-example/multiple-struts-
configuration-files-example-1.html
http://struts.apache.org/development/1.x/apidocs/org/apache/struts/action/ActionFor
m.html
http://struts.1045723.n5.nabble.com/reset-method-in-ActionForm-td3439650.html
http://mail-archives.apache.org/mod_mbox/struts-user/200601.mbox/
%3Cb0b4de6e0601031049v6c6752c5hddd2acf8686a3252@mail.gmail.com%3E

Note:The configs are loaded on server startup, not after receiving a request. You'd
have to come up with a different way to identify which config you want to
load.

SDLC
=====
http://www.techopedia.com/definition/22193/software-development-life-cycle-sdlc
http://www.tutorialspoint.com/sdlc/sdlc_agile_model.htm
http://www.techopedia.com/definition/25895/iterative-and-incremental-development
http://c2.com/cgi/wiki?IterativeVsIncremental
http://www.testingbrain.com/
http://searchcio.techtarget.com/definition/project-scope

Design Patterns
===================
http://www.allapplabs.com/java_design_patterns/java_design_patterns.htm
http://javapapers.com/design-patterns/observer-design-pattern/
http://www.tutorialspoint.com/design_pattern/strategy_pattern.htm
http://howtodoinjava.com/2012/10/23/implementing-factory-design-pattern-in-java/

You might also like