Java Questions in Word
Java Questions in Word
Q2: What is JVM? Why is Java called the "Platform Independent Programming Language”?
Q3: What is the Difference between JDK and JRE?
Q4: What is the difference between an Applet and a Java Application?
Q5: What is a Servlet?
Q6: What is a JSP Page?
Q7: Explain what is Binary Search.
Q8: How HashMap works in Java?
Q9: What are the Data Types supported by Java? What is Autoboxing and Unboxing?
Q10: What does System.gc() and Runtime.gc() methods do?
Q11: What is the difference between processes and threads?
Q12: What differences exist between HashMap and Hashtable?
Q13: What is the difference between Exception and Error in Java?
Q14: What does the static keyword mean? Can you override private or static method in Java?
Q15: What are the basic interfaces of Java Collections Framework?
Q16: What is an Iterator?
Q17: What is the purpose of Garbage Collection in Java, and when is it used?
Q18: When does an Object becomes eligible for Garbage Collection in Java ?
Q19: What is the importance of finally block in exception handling?
Q20: What are pass by reference and pass by value?
Q21: What is an Java Applet?
Q22: What will happen to the Exception object after exception handling?
Q23: What is the difference between an Interface and an Abstract class?
Q24: What do you know about the Big-O notation and can you give some examples with respect to
different data structures?
Q25: What is Function Overriding and Overloading in Java?
Q26: What is the purpose Class.forName method?
Q27: What is JDBC?
Q28: What are Directives?
Q29: What’s the difference between sendRedirect and forward methods?
Q30: What are Declarations?
Q31: What are JSP Actions?
Q32: What is the design pattern that Java uses for all Swing components?
Q33: What are Expressions?
Q34: How are the JSP requests handled?
Q35: Explain the architecture of a Servlet.
Q36: Explain Serialization and Deserialization.
Q37: What is reflection and why is it useful?
Q38: How does Garbage Collection prevent a Java application from going out of memory?
Q39: What is a Constructor, Constructor Overloading and Copy-Constructor in Java ?
Q40: Why Collection doesn’t extend Cloneable and Serializable interfaces?
Q41: Which Swing methods are thread-safe?
Q42: What is the tradeoff between using an unordered array versus an ordered array?
Q43: What is the applet security manager, and what does it provide?
Q44: Explain different ways of creating a thread. Which one would you prefer and why?
Q45: How does finally block differ from finalize() method?
Q46: What is Comparable and Comparator interface? List their differences.
Q47: What are untrusted applets?
Q48: What is Java Priority Queue?
Q49: What happens when an Applet is loaded?
Q50: When is the finalize() called? What is the purpose of finalization?
Q51: What is structure of Java Heap?
Q52: Does Java support multiple inheritance?
Q53: What differences exist between Iterator and ListIterator?
Q54: What is difference between fail-fast and fail-safe?
Q55: What’s the difference between Enumeration and Iterator interfaces?
Q56: What is the difference between throw and throws?
Q57: Explain the life cycle of an Applet.
Q58: What are the restrictions imposed on Java applets?
Q59: Can you access non static variable in static context?
Q60: What is the importance of hashCode() and equals() methods?
Q61: What is difference between ArrayList and LinkedList?
Q62: If an object reference is set to null, will the Garbage Collector immediately free the memory
held by that object?
Q63: What is difference between Array and ArrayList? When will you use Array over ArrayList?
Q64: What’s a deadlock?
Q65: What is the advantage of PreparedStatement over Statement?
Q66: Explain the role of Driver in JDBC.
Q67: What are Scriptlets?
Q68: What is the role of stub in RMI?
Q69: What is the difference between an Applet and a Servlet?
Q70: What are the steps involved to make work a RMI program?
Q71: What is meant by JSP implicit objects and what are they?
Q72: What is the difference between doGet() and doPost()?
Q73: What is the difference between GenericServlet and HttpServlet?
Q74: Explain the life cycle of a Servlet.
Q75: What is the relationship between an event-listener interface and an event-adapter class?
Q76: What is a Server Side Include (SSI)?
Q77: What are the advantages of JSP?
Q78: What is the volatile keyword useful for?
Q79: What is static initializer?
Q80: What is the difference between public, protected, package-private and private in Java?
Q81: What are the differences between == and equals?
Q82: Is there anything like static class in Java?
Q83: How can I synchornize two Java processes?
Q84: What is a JavaBean exactly?
Q85: Can an enum be extended?
Q86: What is the JIT?
Q87: What is the difference between HashMap, LinkedHashMap and TreeMap in Java?
Q88: Compare the sleep() and wait() methods in Java
Q89: Can == be used on enum?
Q90: What is the Java Classloader?
Q91: Is Java pass-by-reference or pass-by-value?
Q92: What is the difference between final, finalize and finally?
Q93: How threadsafe is enum in Java?
Q94: How do I break out of nested loops in Java?
Q95: How and where are Annotations used in Java?
Q96: What is the main difference between StringBuffer and StringBuilder?
Q97: What's the advantage of using getters and setters?
Q98: Why does Java have transient fields?
Q99: What do the ... dots in the method parameters mean?
Q100: What’s the difference between a ClassNotFoundException and NoClassDefFoundError?
Q101: Explain Boyer-Moore Algorithm with Example
Q102: How do you ensure that N threads can access N resources without deadlock?
Q103: Explain the available thread states in a high-level.
Q104: What is Perm Gen space in Heap?
Q105: What is the difference between a synchronized method and a synchronized block?
Q106: What is the difference between Serial and Throughput Garbage collector?
Q107: What is the difference between Applets loaded over the internet and Applets loaded via the
file system?
Q108: What is the applet class loader, and what does it provide?
Q109: What are some of the best practices relating to the Java Collection Framework?
Q110: Explain Marshalling and Demarshalling.
Q111: What is the role of Remote Interface in RMI?
Q112: What is Servlet Chaining?
Q113: What is the basic principle of RMI architecture?
Q114: What is the role of the java.rmi.Naming Class?
Q115: How do you find out what client machine is making a request to your servlet?
Q116: What is meant by binding in RMI?
Q117: What is the purpose of using RMISecurityManager in RMI?
Q118: What does Connection Pooling mean?
Q119: What is RMI?
Q120: Why is Spring MVC better than Servlets / JSP ?
Q121: Explain a use case for the Builder Design Pattern
Q122: What exactly is marker interface in Java?
Q123: What are the differences between a HashMap and a HashTable in Java?
Q124: Why is char[] preferred over String for passwords?
Q125: When to use LinkedList over ArrayList in Java?
Q126: What is Double Brace initialization in Java?
Q127: Does Java support default parameter values?
Q128: How do I test a private function or a class that has private methods, fields or inner
classes?
Q129: What is the main difference between an inner class and a static nested class in Java?
Q130: Are there any differences between Protocol in Swift vs Interface in Java? Related To:
Q131: Does Garbage collection occur in permanent generation space in JVM?
Q132: What is the difference between HashSet and TreeSet?
Q133: How does thread synchronization occurs inside a monitor? What levels of synchronization can
you apply?
Q134: What are the layers of RMI Architecture?
Q135: What is DGC? And how does it work?
Q136: Why ArrayList are preferable in many more use-cases than LinkedList?
Q137: Provide some examples when a finally block won't be executed in Java?
Q138: What's wrong with Double Brace Initialization in Java?
Q139: What is an efficient way to implement a singleton pattern in Java?
Q140: Why isn’t String‘s length() accurate?
Q141: What does synchronized mean?
Q142: Compare volatile vs static variables in Java
Q143: What's the difference between SoftReference and WeakReference in Java?