1.How do you connect to the Database? Write the code for establishing and connecting the Database. 2.User Name,Password stored in a file or memory? 3.Which type of driver you have used in your project? why? 4.How many driver types are available? Explain them. 5.Statement, Prepared Statement,Callable Statement.Of these which Statement you have used? why? 6.Difference between String and StringBuffer? 7.What is Immutable? 8.What is Collections? 9.Difference between Hashtable and HashMap? 10.Difference between ArrayList and Vector? When will you use ArrayList and Vector? 11.Explain Reflection.Whats its uses? 12.What is Singleton class? how do you create it? what is the use of it? 13.Difference between Abstract class and interface? When will you use interface and abstract class? 14.In System.out.println What is System,out, and println? 15.Can a class has more than one main method? 16.What is runtime polymorphism and compiletime polymorphism? Tell me the examples for each. can you write a program to explain runtime and compiletime polymorphism? 17.What is Overriding and Overloading? write a small program for these? 18.Explain types of Exception. 19.What is static block? 20.Whats the use of ApacheAnt? How do you configure it. 21.Tell me the command for creating jar file using ApacheAnt. 22.What IDE are you using? 23.What Application Server are you using? 24.Did you create stored procedures in Oracle? 25.You have finished your web application project, then convert into EAR or WAR.. 26.Explain line by line jdbc coding to call stored procedure.
27.What is socket? and what for it? 28.Is Jsp threadsafe? How will you make it threadsafe? 29.How will you achieve threadsafe for servlets? 30.How do you create thread? and really whats it? 31.What is serialization? whats the use of it? how will you make a class serializable. 32.What is marker interface? tell me one example. 33.What is recursion? write a program to reverse the given string using recursion. 34.How do you create and throw your own exception? write the syntax. 35.For each request, servlet's instance is created. this is true or false. 36.How servlets handle multiple requests? 37.Explain your daily work in your company? 38.Do you know about CVS and PVCS? 39.Is Applet threadsafe? 40.How do you create and activate Button in Swing? 41.Difference between awt and swing? 42.Life cycle of Servlets? 43.Difference between doPost and doGet. 44.Difference between forward and sendRedirect. 45.What are the advantages of JSP over servlets? 46.Explain Call-by-value and Call-by-reference. 47.A=20 and B=30. write the sample codes to swap the values of A and B without declaring any new variable. 48.int[] a = {12,23,43,45,56}. write the logic codes to reverse the elements in the given array a. 49.Write a program to arrange given strings in ascending order.(without using TreeSet) 50.What is OOPs? 51.Why do we go for encapsulation, inheritance and Polymorphism? 52.How do you acheive encapsulation? 53.What is abstraction? Explain it.
54.What are the Objects in JavaScript? 55.Explain onClick and onBlur events in JavaScript. 56.Where do you store web.xml file? 57.What is JSTL? have you used these in your project? 58.Have you created any tags of your own? 59.What is Bean? 60.Explain the term implicit objects and what are they? 61.Why java is called platform independent? 62.How will you make a class not inherited by other class? 63.I want to declare a text field with length of 15 characters only. then How do you use the onClick event to instruct the user? write the code. 64. class Class1{} class Class2 { public static void main(String args[]) { Class2 c2 = new Class2(); c2.meth(null); } public void meth(String str) { System.out.println("String"); } public void meth(Object obj) { System.out.println("Object"); } } What is the output? 65. class Class1{} class Class2 { public static void main(String args[]) { Class2 c2 = new Class2(); c2.meth(null); } public void meth(int i) { System.out.println("integer"); } public void meth(Object obj) {
System.out.println("Object"); }
} now what is the output? 66. class Class1{} class Class2 extends Class1 { public static void main(String args[]) { Class2 c2 = new Class1(); c2.meth(null); } public void meth(int i) { System.out.println("integer"); } public void meth(Object obj) { System.out.println("Object"); } } now what is the output? 67. class Class1{} class Class2 extends Class1 { public static void main(String args[]) { Class1 c1 = new Class2(); c1.meth(null); } public void meth(int i) { System.out.println("integer"); } public void meth(Object obj) { System.out.println("Object"); } } now what is the output? 68.what is JVM? Can you explain its architecture. 69.What is design pattern? 70.Explain briefly about BlockBox and WhiteBox testing? 71.Types of EJB Beans. 72.What is web container? 73.What is tunnelling?
74.Use case diagram. 75. class Sample { int x; static { x++; } public static void main(String args[]) { } System.out.println(x); } What is the value of x? 76. class Sample { int x; static { x++; } public static void main(String args[]) { System.out.println(x); } } now What is the value of x? 77. class Sample { static int x; static { x++; } public static void main(String args[]) { System.out.println(x); } } 78. class Sample { static int x;
static { x++; } public static void main(String args[]) { System.out.println(x++); } } now What is the value of x? 80. class Sample { static final int x; static { x++; } public static void main(String args[]) { System.out.println(Sample.x); } } now What is the value of x? 81. import java.io.*; class Sample { static int x; static { throw new IOException(); x++; } public static void main(String args[]) { System.out.println(Sample.x); } } now whats the result? (Compile time error will occur) the following code works fine.. static { try { throw new IOException(); }
catch(Exception e) { System.out.println(e); } x++; } 82.Whats the use of transient keyword? 83. class MyClassA { public int myMethod(int a,int b) { return a*b; } } class MyClassB extends MyClassA { public double myMethod(int c,int d) { return c+d; } } here the method myMethod is overloading or overriding? 83. class MyClassA { public int myMethod(int a,int b)throws IOException { return a*b; } } class MyClassB extends MyClassA { public int myMethod(int c,int d) { return c+d; } } Now here the method myMethod is overloading or overriding? 84. import java.io.*; class MyClassA { public int myMethod(int a,int b)throws IOException { return a*b; }
} class MyClassB extends MyClassA { public int myMethod(int c,int d) { return c+d; } } class MyClass extends MyClassB { public int myMethod(int e,int f) { return e-f; } public static void main(String args[]) { MyClassA ma = new MyClass(); System.out.println(ma.myMethod(4,4)); } } What is the output? 85. import java.io.*; class MyClassA { public int myMethod(int a,int b) { return a*b; } } class MyClassB extends MyClassA { public int myMethod(int c,int d) { return c+d; } } class MyClass extends MyClassB { public int myMethod(int e,int f) { return e-f; } public static void main(String args[]) { MyClassA ma = new MyClass(); System.out.println(ma.myMethod(4,4)); } }
What is the output? 86.Explain NoClassDefFoundError and ClassNotFoundException. 87.String is a keyword or not. 88.Difference between equals() and ==. 89.A vector having some elements. Write codes to empty the vector by using remove() only. 90.Difference between include action and include directive in JSP. 91.What is cookies? 92.what is session tracking? what are ways available for session tracking? 93.write codes to create a session for an user? 94.What are Filters? 95.Will it compile or not? static public void main(String args[]) { //.... } (no problem it will compile) 96.Now Will it compile or not? public void static main(String args[]) { //.... } 97.What are the tags available in JSP? 98.Types of scopes in JSP? 99.Whats the difference between a variable declared in delclaration tag and a variable declared in scriptlet tag. 100.How will you create error page in JSP? 101.What do you know about Generics in Java? 102.Tell me the methods of Object class? 103.How will you pass an request from one servlet to other.. what are they? 104.Write a sql query using join. 105.How can you delete all the tables? 106.Write a query to retrieve second largest value in a table (for eg. salary in employee table). 107.What are the scopes available in JSP? Explain when to use everyone?
108.How do you encapsulate data? 109.Difference between request.getParameter() and request.getAttribute()? 110.When do you use static and when do you use instance variable?