Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Core Java Interview Questions
Questions Answers Views Company eMail

What is Distributed Application and what is its usage?

2 5634

Explain in detail about encapsulation with an example?

4 10538

What is meant by event handling?

2 6674

What is an exception?

6 7991

What is meant by final class, methods and variables?

3 8808

What is the difference between getCodeBase and getDocumentBase methods?

CS Business Services,

1 12062

explain the concept of inheritance with an example?

Polaris,

9 25493

Define interface?

MindCracker,

3 5808

What is files manifesting?

2151

Explain method overloading and overriding?

6 14864

What is meant by packages?

4 10469

Explain the concept of polymorphism with examples?

Summation Tech,

6 13215

What is meant by serialisation and deserialisation?

4 8871

What is static variable and static method?

Accenture, Prolific, Prolifics, TCS, TNH,

32 104087

Explain about vector, dictionary,hash table, property classes?

Patni,

1 9502


Post New Core Java Questions

Un-Answered Questions { Core Java }

Do extraneous variables affect validity?

880


Explain the difference between abstract classes and interfaces in java?

1114


How do you pass by reference?

999


Is ++ operator thread-safe in java?

1125


When is the finalize() called? What is the purpose of finalization?

1029


Explain the difference between string, stringbuffer and stringbuilder in java?

969


How do you use compareto?

901


How to find the index of the largest number in an arraylist java?

977


What is an immutable object? How do you create one in java?

1034


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)

1895


What is the syntax and characteristics of a lambda expression?

997


What is the difference between static (class) method and instance method?

1043


What happens if an exception is not handled in a program?

1063


How do you know if a value is nan?

1027


What is a conditional statement explain with example?

978