Java Interview Questions and Answers - 15 Minutes - Free - Live Webinar

Register

To receive Webinar materials Register here

 

Java Interview Questions and Answers



1. What is class/object diagram ?

Answer : A class is an entity that determines how an object...



2. How to print a message to console without using main() function?(do not use even static blocks also.)

Answer : You could define a custom class loader...



3. Explain the struts-configuration file ?

Answer : The struts-config.xml configuration file is a link...



4. Difference between JDBC and Hibernate ? Give one sample based on the variance ?

Answer : JDBC(Java Database Connectivity) is an API which is used to access database...



5. How OOPS concept is achieved in Java ?

Answer : The following stages are the concept of oops achieved in Java...



6. Explain Exception Handling in Java ?

Answer : Exception in Java represents that problem arises during the execution of the program...



7. What is the purpose of method overriding in java where we are completely re-defining a inherited method ?

Answer : Declaring a method in sub class which is already present in parent class...



8. What is Polymorphism in Java ?

Answer : Polymorphism in Java is a concept in different ways...



9. How HashMap Works in Java ?

Answer : HashMap is one of the most widly used implementation of Map to store key-value pairs...



10. What is static and dynamic binding in Java ?

Answer : The binding which can be determined at compile time by compiler...



11. What is final, finally and finalize ?

Answer : Final is used to apply limitations on class, method and variable...



12. How to count number of characters in a string ?

Answer : To count the amount of 'x' characters that are in a string...



13. How to find the Longest Palindrome String in Java ?

Answer : A palindrome is a word, phrase, number, or other sequence of characters...



14. Difference Between static and dynamic binding in Java ?

Answer : Events occur at compile time....



15. How to decode URL content in Java ?

Answer : The task to the reverse of URL encoding and distinct from URL parser is called Url Decoding...



16. What is Linear Sort in Java ?

Answer : One of the simplest Sorting techniques is a linear sort...



17. How to check if two rectangles intersect or not ?

Answer : The following standard Java coding practices to solve...



18. How to Copy One Array to Another in Java ?

Answer : Java provides inbuilt methods to copy array...



19. How to Count Occurrence of a given Character in a String in Java ?

Answer : The number of occurrences of each character to be count...



20. Design Patterns in Java where input n=4, output like
1
2 3
4 5 6
7 8 9 10 ?

Answer : Pattern is an underlying structure that organizes surfaces...



21. How to find next greater element for every element in an array ?

Answer : In an array, to display the Next Greater Element (NGE)...



22. How to check if a string contains the sequences of characters or not using java ?

Answer : java.lang.String.contains() method searches the sequence of characters...



23. How to optimally divide an array into two subarrays so that sum of elements in both are same ?

Answer : Given an array of integers greater than zero...



24. Find number of occurrence of each of the unique characters in a string ?

Answer : In this program an approach using Hashmap....



25. Why do we need garbage collection?

Answer : Java garbage collection is the method by which Java programs ....



26. Java Program to reverse a Linked List ?

Answer : A Linked list contains two things data and the address of the node each node....



27. To find the middle element of a linked list in java ?

Answer : Given a singly linked list, find middle of the linked list...



28. Java program to find second largest number in an array ?

Answer : Given an array of integers, our task is to write a program...



29. Difference between JDK JRE and JVM ?

Answer : Java Development Kit is the core component...



30. Difference between NoClassDefFoundError and ClassNotFoundException in java ?

Answer : ClassNotFoundException and NoClassDefFoundError occur when a particular...



1. Difference between wait() and sleep() in Java ?

Answer : wait() Method of thread class goes in waiting state ...





Related Searches to Java Interview Questions and Answers