Core Java Interview Questions
Questions Answers Views Company eMail

What is garbage collection in Java, and how can it be used ?

Infosys, HCL, Accenture, Wipro, Sara, SITS, TCS,

32 55422

Differentiate Vector and ArrayList?

Wipro, Max Telecom,

6 7351

Differentiate constructor and a method and how are it be used?


7 7899

What is an abstract class?


7 6708

How can final class be used?

Wipro, Accenture,

5 8612

By what default value is an object reference declared as an instance variable?


1 9958

Java support what type of parameter passing ?


7 11225

Explain the term serialization?


10 9048

Is there is any error if you have multiple main methods in the same class?

Wipro, Infosys,

10 10406

What is Overriding and how can it be used?

Consagous, Wipro,

7 12937

Explain pass by reference and pass by value?

IBM, Wipro,

8 11187

In which way does a Primitive data type is passed ?

Sun Microsystems,

5 7190

What happens when a main method is declared as private?

L&T, DELL, Infosys, Sun Microsystems,

22 34460

Is there any need to import java.lang package?

Sun Microsystems,

13 14424

What is UNICODE?

3 4133

Post New Core Java Questions

Un-Answered Questions { Core Java }

what is the messsage u r going to get from an objectoriented programing?


which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at


Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?


How to display names of all components in a Container?


what is the use of bean managed and container managed with example?


What methods are used in Servlet?Applet communication?


How to add and remove nodes in Jtree?


Name the components that are termed to be Heavy-weight component but available in Light-weight components?


The following program reads data (details of students) from a file named students.txt and converts it into e-mail addresses. The results are written to a file named studentemail.txt. students.txt consists of a number of lines, each containing the data of a student in colon delimited format: Last Name:First Name:Student Number Each input record is converted to an e-mail address and written to studentemail.txt in the following format: the first character of the last name + the first character of the first name + the last four digits of the student number + “” import*; public class EmailConverter { public static void main(String[] args) throws IOException { BufferedReader input = new BufferedReader(new FileReader ("students.txt")); PrintWriter output = new PrintWriter(new FileWriter ("studentemail.txt")); String line = input.readLine(); while (line != null) { // Extract the information for each student String[] items = line.split(":"); // Generate the email address String email = "" + items[0].charAt(0) + items[1].charAt(0) + items[2].substring(4,8) + ""; email = email.toLowerCase(); // Output output.println(email); line = input.readLine(); } input.close(); output.close(); } } Rewrite the class so that it handles possible errors that may occur. In particular, it should do the following: • It should catch at least three appropriate exceptions that might occur, and display suitable messages. • At this stage, the program will not run correctly if there is an empty line in the input file. Change the program so that if an empty line is encountered, an exception is thrown and the empty line is ignored. This exception should be handled with the display of a suitable error message. • Before the e-mail address is added to the output file, check if the student number has 8 digits. If not, throw an InvalidFormatException (which the program should not handle itself)


what is object slice?


when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???


What is procedure overloading?


difference between byte stream class and character stream class?


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.


What is Applet Stub Interface ?