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...



Java Related Interview Questions
Questions Answers Views Company eMail

Explain bean in spring and list the different scopes of spring bean?

413

List the different scopes of spring bean?

435

Name the different modules of the spring framework?

464

Explain bean in spring?

389

How do cookies work in servlets?

1051

What are the differences between servlet context vs servlet config?

1092

What are the applications in websphere?

850

What is the difference between weblogic and websphere?

959

What is a remote jms provider?

895

What is nmenroll in wlst?

1022

Inclined to build a profession as oracle weblogic developer?

950

We see an error like 404 and 500. What do they mean?

991

What is thread dump?

941

How can default jvm be changed to others?

1017

What is a messaging bridge?

983


Un-Answered Questions { Java Related }

How to integrate log4j logging in hibernate application?

384


Explain the difference between swing and jsf.

1134


How do I save in hibernate?

465


What are struts in java?

930


Can java hashmap have duplicate keys?

1030


Can you use javascript in servlets?

1088


What is the major difference between context parameter and context attribute?

1116


Are struts thread safe?

972


What is anagram of a string?

947


Can a static block throw exception?

1095


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)

1947


What is an image buffer?

997


Can you call a method on a null object?

1011


What is spring?

404


What is port number in java?

1042