-
-
-
-
-
Inheritance and Aggregation
What is the difference between inheritance and aggregation? When would you use one over the other
-
Can HashMap store null values?If yes, how many?
Can HashMap store null values?If yes, how many?What is singleton class? Give one example.Please describe the difference between 'int' and 'Integer',what is the purpose of 'Integer', where should we use 'Integer' vs 'int'?
-
Java Program to Count Number of Files
50,000 HTML files are in a folder on a windows machine. Among them, content of some files(not the file names) contain the sentence "SocioMaC-Jus' Follow!". Write a Java program to count the number of such files.
-
Class Path
Why should we set class path and path environment variables while installing J2SE and why not while Turbo C?
-
Double Value
What happens when you add a double value to a String?
-
Java Collection
What is the default capacity and load factor in Java Collection? Explain its role.
-
Interface and Abstract Class Usage
When will you use an interface and abstract class?
-
Write a program that prompts the user to input three numbers.
The program should then output numbers in ascending order.
-
Compareto and equals method
Difference between CompareTo and equals method.
-
JUnit
What is JUnit and how it is used?
-
Java - How to convert string to charArray ?
String str="Welcome To GeekInterview.com"
How can convert the above string to charArray without using any buit-in function in java?
Anyone to know the answer.please help me? i am new to learn java. -
Without main Method
How can we use method without using main method in JAVA?
-
What is the difference between preemptive scheduling and time slicing
Under preemptive scheduling, the highest priority task executes until it enters the waitingor dead states or a higher priority task comes into existence. Under time slicing, a taskexecutes for a predefined slice of time and then reenters the pool of ready tasks. Thescheduler then determines which task should execute next, based on priority andother factors.
-
What is the purpose of the finally clause of a try-catch-finally statement
The finally clause is used to provide the capability to execute code no matter whether ornot an exception is thrown or caught.
-
What must a class do to implement an interface
It must provide all of the methods in the interface and identify the interface in itsimplements clause.
-
What happens if a try-catch-finally statement does not have a catch clause to handlean exception that is thrown within the body of the try statement
The exception propagates up to the next higher level try-catch statement (if any) orresults in the program's termination.
Java Interview Questions
Ans