Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Core Java Interview Questions
Questions Answers Views Company eMail

what is use of marker interface? give me good example?

2 4434

what is use of threads how many ways to create thread

iTrust, Verizon,

3 8486

Program to print 1 1 2 1 2 3 1 2 3 4 like that

Huawei,

8 9885

program to find 25 square = 625 here the 625 of last two digits is equal to 25, i don't know excatly what this type of number is called

Huawei,

1 3031

i need to know the website that i can compile and run a java code in online.(while system doesn't contain any jdk and jre)

1208

What is JAVA? Why it is platform independent?

NIIT,

10 9492

i need to know the site which compiles and run the java program completely in online... thank you for your reply in advance

2 2483

what questions are been asked ??? for interview in apti

1203

Features of JAVA ? In which version of java synchronizedXXX() methods are included in Collections class.

NIIT,

1 5412

all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.

4 5130

all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.

CFG,

8 5126

what is class.forname() and how it will be useful ?

3 3678

how and when compiler knows that the Java code throws the checked Exception.

HSBC,

2 10187

diff. b/w JAVA and javascript...

NIIT,

3 4528

what is the difference between String s="hello"; and String s=new String("hello");?

3 11292


Post New Core Java Questions






Un-Answered Questions { Core Java }

What does escaping a character mean?

191


What is java reflection api?

198


What is null mean in java?

230


What is jvm? Why is java called the platform independent programming language?

192


Explain throw keyword in java?

265






why we use merge option in hybernate pls give a ex snippet

1135


What methods are used to get and set the text label displayed by a button object?

201


What are the 3 types of loops in java?

179


Can we extend singleton class in java?

181


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 + “@myunisa.ac.za” import java.io.*; 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) + "@myunisa.ac.za"; 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)

1112


What do you understand by the term singleton?

231


What does split function do in java?

166


Explain the key functions of data binding?

231


Compare Mutex and Semaphore in java.

216


Is space a char?

184