Java J2EE Interview Questions
Questions Answers Views Company eMail

How can we display validation errors on jsp page?

529

What is the configuration files used in struts?

520

What are the core classes of struts framework? Explain

524

What do you mean by tiles in struts?

532

What do you mean by ognl?

552

What do you mean by actionform?

575

What do you mean by annotations in servlet?

577

How we can call a jsp from the servlet?

529

What do you mean by cgi in servlet?

624

What do you mean by chaining in servlet?

566

Explain url encoding in servlet?

573

Explain the difference between servletconfig and servletcontext in servlet?

563

Explain the difference between a web server and a web container?

504

What do you mean by singlethreadmodel interface?

576

What do you mean by session tracking?

665


Un-Answered Questions { Java J2EE }

What must a class do to implement an interface in java programming?

529


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)

1447


What is collection class in java?

539


What is the purpose of @before annotation?

580


What inheritance mapping strategies are available in hibernate?

192






what is synchronization? : Java thread

554


When we serialize an object does the serialization mechanism saves its references too?

501


What do you understand by access specifiers in Java?

580


What is cookies in servlet with example?

514


How can we map the classes as immutable?

163


What are action errors and error?

571


What is an exception in java?

638


Hi Friends , am newbie to ajax. For example just consider one account registration - A form contains 8 text fields with submit button. In this form second texbox contains "username " . On right side of text box there is a label box . On clilck action i need to determine user is available or not. Is it possible on clicking label or should i click submit button.

1579


What is lazy loading effect?

185


Can you explain what are the ways in which the dns request of failed servers handled?

515