ADVANCED JAVA AND J2EE
FAQ
MODULE - 1
1. Define an Enumeration?Explain with a program how to define and access an enumeration?
2. Explain the following methods with an example
1. values() 2. valueOf() 3. ordinal() 4. compareTo() 5. equals()
3. Construct and explain with an example how an enumeration will be used in
constructors, instance variables and methods?
4. Define type Wrapper? Explain the different types of type Wrappers?
5. Design and demonstrate with an example how autoboxing and auto unboxing will be used in java?
6. Explain how to declare and define an annotation with an example?
7. Explain the different types of retention policies in annotation?
8. Define and construct Reflection with an example?
9. Write a java program to obtain all annotations using reflection?
10.Demonstrate the use of Default values in reflection using java program?
11. Explain the marker annotations with an example?
12. Explain marker annotations, Single member annotation and built in annotations with an example.
MODULE -2
1.List and explain collection interfaces
2.Design a program using ArrayList<string> which has following elements (A, C, D, E, B,F) and display the content using Iterator, List Iterator and for each loop.
3.write a java program to obtain an array from an arraylist?
4. Explain the following collection classes with a simple program?
1) LinkedList 2) HashSet 3) LinkedHashSet 4)TreeSet 5)PriorityQueue 6)ArrayDeque
5.Explain storing userdefined classes in collections.
6.Describe HashMap class. Write a program to enter the following pair of elements into a Hashmap<string,double>
NAME SALARY
John 345.26
Nike 4458.9
Todd 7523.23
Jerry 2658.3
Display the contents and then modify To add salary to 6700 using get() and put() function.
NAME SALARY
John 345.26
Nike 4458.9
Todd 7523.23
Jerry 2658.3
Display the contents and then modify To add salary to 6700 using get() and put() function.
7.Explain the following Map classes with simple program
1) TreeMap 2) LinkedHashMap 3) IdentityHashMap 4)EnumMap
8. What is Comparator? Write a program to reverse the order of TreeSet<string> using Comparator( use [q,w,e,r,t,y] as elements to TreeSet).
9.Write a brief note on legacy classes and interfaces.(list all classes and briefly illustrate)
MODULE -3
1. Explain String Constructors with an example.(list and brief each constructor)
2. Explain String Conversion and toString() with an example.
3. Design a program to override toString() (which displays an object using SOP, append to string and display string)
4. Explain the following string methods with a program
1. charAt() 2. getChars() 3. getBytes() 4. toCharArray() 5. equals() and equalsIgnoreCase()
6. regionMatches() 7. startsWith() and endsWith() 8. equals() versus == 9. compareto()
5. How do you use the following(illustrate with a code snippet)
a. LastIndexOf(String Str, int StartIndex)
b. equalsIgnoreCase(String str)
c. replace()
d. trim()
e. reverse()
a. LastIndexOf(String Str, int StartIndex)
b. equalsIgnoreCase(String str)
c. replace()
d. trim()
e. reverse()
6. Explain the difference between String and StringBuffer. Explain following methods
under StringBuffer 1) delete 2) deleteCharAt 3)replaceFirst 4)split 5)replaceAll
under StringBuffer 1) delete 2) deleteCharAt 3)replaceFirst 4)split 5)replaceAll
7. Explain how to change the case of characters within a string with an example.
MODULE -4
1. Explain the life cycle of servlets.
2. List and explain core classes and interfaces in javax.servlet package.
3. Write a short note on handling HTTP Requests and Responses.
4. What is a Cookie? List out the methods defined by Cookie. Write a java program to add
Cookie.
5. Define JSP. Explain different types of JSP tags by taking suitable example.
6. Discuss about Session management and session tracking techniques of java servlets.
7. List and explain classes and interfaces in javax.servlet.http package.
8. Explain how to read servlet parameters with an example.
MODULE -5
1. Explain the life cycle of servlets.
2. List and explain core classes and interfaces in javax.servlet package.
3. Write a short note on handling HTTP Requests and Responses.
4. What is a Cookie? List out the methods defined by Cookie. Write a java program to add
Cookie.
5. Define JSP. Explain different types of JSP tags by taking suitable example.
6. Discuss about Session management and session tracking techniques of java servlets.
7. List and explain classes and interfaces in javax.servlet.http package.
8. Explain how to read servlet parameters with an example.
MODULE -5
1. Explain the four types of JDBC drivers.
2. Describe the various steps of JDBC with code snippet.
3. Write a program to execute a database transaction.
4. Write a program using savepoints in a transaction.
5. Explain the Statement objects with program.
6. List and explain the ResultSet with program.
7. Explain the database connection.
8. Explain the types of exception occurred in JDBC.