You are on page 1of 10

Interview Questions for Java (5489) 1.Can we call destroy() method on servlets from service method? 2.

What is difference between cgi and servlet in interview point 3.What is innerclass 4.What is the command pattern ?where it is used? 5.How to copy from one script to another script in qtp 6.What method is used to specify a container's layout? 7.Which of the following statement is true regarding the three tier model in the JDBC driver model architecture. 8.1-explain singleton pattern in java2-explain up casting and down casting3-how do u code a singleton in java4-How do u read XML file in java5-gine an example o f the Decorator pattern in the java API.6-What r the services provided by the co ntainer?7-what r bean managed transaction?8-what r transaction attributes?9-what is JTS? 9.Can I just abort processing a JSP? 10.Can we override the service method?if we can do that then why do we override only doGET()and doPost() methods if the servlet is of protocol specific? 11.I have been doing the java project using JBuilder 2.0 as front end and oracle 8i as back-end .I can't connect to oracle using JBuilder 2.0 please say detaile d code for that coding. whether i have to import extra other than import java.sq l.*; when ever i import the import oracle.jdbc.driver.Error"cannot access direct ory oracle/jdbc/driver". 12.What is DispatchAction? 13.What is EJB architecture(components) 14.What is Entity Bean. What are the various types of Entity Bean? 15.What is the relationship between the Canvas class and the Graphics class? 16.What is the use of unicast remote object 17.How can you use PreparedStatement? 18.How to retrieve a whole row of data at once, instead of calling an individual ResultSet.get XXX method for each column? 19.What are the implicit objects in JSP & differences between them? 20.What is difference between & and && in java 21.What version of JBoss AS do I need to run Seam? 22.Which of the statements is true regarding loading a driver in JDBC.1. registe rDriver(Driver driver).2. Class.forName(java.lang.String driverclass) 23.How can a Variable in a class other than String type be made Immutable.

24.How to call static method? 25.What are the files generated after using IDL to Java Compilet? 26.What are the uses of Servlets? 27.What happens when a thread cannot acquire a lock on an object? 28.What is difference between servlet and ASP? 29.What is J2EE component ? 30.What is Personal Profile 31.What state does a thread enter when it terminates its processing 32.When is the finally clause of a try-catch-finally statement executed? 33.Why are the methods of the Math class static? 34.How many ways we can destroy the servlet in ur program 35.Mention 5 basic difference between Array List and Vector in Java Colletion Fr ameWork. 36.How can you push data from an Applet to Servlet? 37.How to call static method in Java? 38.How to communicate 2 threads each other? 39.How we can find the total number of processors available in system? 40.Suppose number of servlets/jsps from various web applications want to access shared data, what is the mechanism to achieve the same? 41.What are statements in JAVA? 42.What configuration files are used in Struts? 43.What is Generic Connection Framework? 44.What is GSM ? 45.What is the differance between equals() method and == 46.What is the lifecycle of Entity Bean 47.What is the purpose of the System class? 48.When does a plugin get started? 49.What are the uses of Servlets? 50.What is the % operator? 51.What is the difference between local interface and remote interface?

52.Can every SAP Customer download and install SAP JCo or SAP Java IDoc Class Li brary free of cost? 53.How does a custom RowSetReader get called from a CachedRowSet? 54.What is the difference between bean:write and bean:message 55.What is the significance of null interface in Java? 56.What is the Set interface? 57.What an I/O filter? 58.What is the difference between find and select methods in EJB 59.Can i know what are methods that a classloader calls when it is loading the c lass 60.In normal javabean, bean object is serailizable,and Connectuin object is tran sient object.Then How we using javabean for communnication between Servlet and J SP for data Transfer? 61.Is stateless Sessiob bean create() method contains any parameters 62.What is MIDlets Suite? 63.When you have an object passed to a method and when the object is reassigned to a different one, then is the original reference lost 64.Will class level variables are garbage collected? 65.How are this() and super() used with constructors? 66.I want to know how to encode textbox in servlet so we find complete column in formation from the database 67.What is synchronization and why is it important 68.What is synchronization and why is it important? 69.What is the purpose of the Runtime class? 70.When we increase the buffer size in our project using page directive attribut e 'buffer' what changes 71.Can I invoke a JSP error page from a servlet? 72.What is an Abstract Method? 73.What is Session Bean. What are the various types of Session Bean? 80.What is the difference between GenericServlet and HttpServlet? 81.Are you familiar with the term MESI? 82.Can an object be garbage collected while it is still reachable? 83.How can we use mapping variables in Informatica? Where do we use them?

84.How does the Java Database Connectivity (JDBC) work? 85.When two entity beans are said to be identical?Which method is used to compar e identical or not? 86.What is autoboxing? 87.How are Java source code files named? 88.How will you call an Applet using a Java Script function? 89.What is the classpath of a plug-in? 90.When you will chose Stateful session bean and Stateless session bean? 91.Can undefined primary keys are possible with Entity beans?If so, what type is defined? 92.What are the flow statements of JDBC? 93.What is the AWS Toolkit for Eclipse? 94.Which of the following allows phantom read in JDBC, connection class? 95.Why not declare an ArrayList if you want to hold ints? 96.What is Enterprise JavaBeans Query Language? 97.What is list interface? 98.What is re-entrant. Is session beans reentrant. Is entity beans reentrant 99.What restrictions are placed on method overloading? 100.How can the Checkbox class be used to create a radio button? 101.How the jsp changes will be effected in servlet file after converting? 102.What happens in Integer.parseInt() if the thing you pass isn't a number? And does it recognize spelled-out numbers, like "three" ? 103.What is CMR 104.Does Java has pointer? 105.How can a dead thread be restarted? 106.when should we extend JavaBean class? 107.How do I use comments within a JSP page? 108.How will you pass values from HTML page to the Servlet? 109.How you will enable front-end validation based on the xml in validation.xml? 110.What is JSP tag handler ? 111.What Class.forName will do while loading drivers?

112.Where did Eclipse come from? 113.What is difference between EJB 1.1 and EJB 2.0 114.What is JBOSS? 115.Which containers use a border Layout as their default layout? 116.Why init is used and not constructor for servlets initialization? 117.Can there ever be more than one program running on a single port? In other w ords, can two applications on the same server have the same port number? 118.What is Instance pooling? 119.What is JavaServer Faces Technology ? 120.Which Math method is used to calculate the absolute value of a number? 121.Which isolation level prevents dirty read in JDBC, connection class. 122.What is a void return type? 123.What is the difference between importing a classand creating the object for that class 124.Is null a keyword? 125.What are the differences between Visual Basic, VBA and apple Script? When wo uld it be appropriate to use one as opposed to another? 126.Which of the following describes the correct sequence of the steps involved in making a connection with a database.1. Loading the driver2. Process the resul ts.3. Making the connection with the database.4. Executing the SQL statements. 127.Is J2EE advanced version of Java? 128.why use jsp over servlet.what is the benefit of jsp over servlet? 129.Are true and false keywords? 130.Can a for statement loop indefinitely? 131.Can an exception be rethrown? 132.Can an exception be rethrown? 133.Can the abstract class be final? 134.Can we have a function Overloading with same number of arguments but with di fferent return types of function 135.Define lexical analysis? 136.Difference between Applet and JApplet 137.Explain 2 tier and 3 -tier Architecture?

138.Features of JAVA ? In which version of java synchronizedXXX() methods are in cluded in Collections class. 139.how convert java file to jar files? 140.how to swap 2 variables without using third temp variable in java? 141.How can I determine where a given table is referenced via foreign keys? 142.How can I pool my database connections so I don't have to keep reconnecting to the database? 143.How can I retrieve a String or other object type without creating a new obje ct each time? 144.How can I secure the communication between SAP JCo and an SAP System? 145.How does a server know when another server is unavailable? 146.How many types of protocol implementations does RMI have? 147.How to check for repeated patterns in a password? 148.How to create Connection interface object because it is Interface , Interfac e is not instansiated? 149.How to Retrieve Warnings? 150.How to sort String, for example: abced. to change to abcde ? 151.How to use c/c++ code in JAVA 152.How to use C++ code in Java Program? 153.How to Upload a textfile from JSP to Servlet 154.How we can code in a jcl to execute a job in a particular time and date with out using any job shudular?. (Eg) i want to execute a particular job at 8 am on 01/01/2010. 155.How will you pass parameters in RMI. Why u serialize? 156.if two overloaded methods are-Test(Object xyz) and test(Customer cust)[Assum e Customer is a class with member name of type String].Now if we call test(null) , which method will be called? why? 157.If a class is declared without any access modifiers, where may the class bea ccessed 158.If a method is declared as protected, where may the method be accessed? 159.In Execption handling What is exactly difference between throws and throw? 160.In overriding, the super class method throws I/O exception & in sub class th at method throws arithmetic exception. what happens? 161.Is java a fully object oriented programming or not? if not why? 162.Is there a separate stack for each thread in Java

163.Isn't it redundant to have to mark the methods final if the class is final? 164.My JCL has 4 steps that execute PROC?s P1, P2, P3 and P4 as shown below//P1E XEC PROC=P1//P2EXEC PROC=P2//P3EXEC PROC=P3//P4EXEC PROC=P4There are four steps S1, S2, S3 and S4 in each PROC?s (i.e. P1, P2, P3 and P4)I want to execute only step S2 of PROC P2 and no other steps or PROC?s. How do you achieve this? 165.The interface _____________ helps us in retrieving the information about the database. 166.This is the portal and portlet interview questionAPI: is JSR 168 APIServer: is ibm web sphere portal server6.0IDE: is RAD 7.0Question:In normal struts what is the actionservlet?Ans:org.apache.struts.action.ActionServlet.ButWhat is the a ctionservlet in strutsportlet? 167.To what value is a variable of the boolean type automatically initialized? 168.watz the difference between abstract class and interface?Which one u ill cho ose as a designer? 169.what is difference between instance and object.? 170.what is main purpose of abstract class? 171.what is struts? why Struts? 172.what is the Arraylist limit (maximum) by default ? 173.write classes/methods to calculate the totallength of a set of lines given t he start and end points taking into account overlapping.E.g.Line 1 start: -1.4, end: 3.2 Line 2start: 2.9, end: 4.1etc..Total length would be:line 1 length = 4. 6 line 2 length =1.2, but as line 2 overlaps line 1 by 0.3, therefore length of set is 5.5(rather than 5.8). 174.What are the core classes of struts? 175.What are the problems faced by Java programmers who don't use layoutmanagers ? 176.What are the purpose of introspection? 177.What class is the top of the AWT event hierarchy? 178.What classes of exceptions may be thrown by a throw statement? 179.What do you mean by marker interfaces? While no methods are presented in the marker interfaces,then what is the need of having them? In what circumstances w e will use marker interfaces? 180.What does the "abstract" keyword mean in front of a method? A class? 181.What does the AWS Toolkit for Eclipse do? 182.What is a local, member and a class variable? 183.What is a modular application? What does module-relative mean? 184.What is abstract method? 185.What is an EJB Context?

186.What is an object's lock and which object's have locks? 187.What is authentication ? 188.What is CVM ? 189.What is default Session time out in the servers like Tomcat, Weblogic, JBoss ,..etc? 190.What is deployment descriptor? 191.What is difference in between Java Class and Bean? 192.What is ETSI? 193.What is Glasgow? 194.What is hybernate and spring? can u suggest any books or documents so that i can go through? 195.What is included in the Rich Client Platform? 196.What is JavaServer Faces conversion model ? 197.What is KXML? 198.What is meant by memory leak? 199.What is MIDlet suite 200.What is Multithreading 201.What is pure servlet? 202.What is POSE 203.What is the difference betweeen JSP forward and servlet forward methods? 204.What is the difference between ActionForm and DynaActionForm 205.What is the difference between Comparable and Comparator 206.What is the difference between the Boolean & operator and the && operator? 207.What is the difference between Vector, Array and Arraylist? 208.What is the diffrence between JAVA Mail and JMS Queue 209.What is the DynaActionForm? How we implement thedynaactionform ? can u pleas e tell me the way to implement?in understandable way? 210.What is the life cycle of Stateful session bean 211.What is the List interface? 212.What is the purpose of the wait(), notify(), and notifyAll() methods? 213.What method used to add a jsp to the servlet

214.What modifiers may be used with an inner class that is a member of an outer class 215.What modifiers may be used with an inner class that is a member of an outerc lass? 216.What packages are used by JDBC? 217.What restrictions are placed on method overloading? 218.What's the purpose of the delay-database-insert-until deployment descriptor element? 219.When should I use the external_stage option? 220.When, where and why we are using overloading and overriding??? 221.Where can I find a JMS API discussion group? 222.Which deployment descriptor used in struts? 223.Which of the following statements is true regarding the failing of the class .forName in jdk 1.1.x. 224.Why are Java ARchive (JAR) files important? 225.Why Java is case sensitive? 226.Why Wait and notify are kept in Object class although they are used only wit h Thread Class 227.Will there be a performance penalty if you make a method synchronized? If so , can you make any design changes to improve the performance 228.With EJB 1.1 specs, why is unsetSessionContext() not provided in Session Bea ns, like unsetEntityContext() in Entity Beans? 229.Write the Java code to declare any constant (say gravitational constant) and to get its value. 230.How many threads will be created for a java program, when it is compail & ru n? and what are they? 231.How to make application thread-safe ? 232.what are Struts and jini? 233.Are there any components or add-ons that must be installed on the SAP System s in order to work with SAP JCo? 234.can we create a object of Base class?..If we can not create a object of base class then why we need Abstract class? 235.can you tell me the steps for how to create and execute and run the Ejb simp le stateless session application in websphere application server6.0 and Ide is R AD6.0 236.Can i expand an interface? 237.Can i limit the initial capacity of vector in java?

238.Can I create final executable from Java? 239.Can I have members of different record length in a single PDS? 240.Can JMS utilities automatically re-establish a connection if one side of the communication link (i.e. an application that's sending/receiving messages) goes down and is restarted? Are there APIs to help detect that the other side broke a connection (went down)? 241.Can the JDBC-ODBC Bridge be used with applets? 242.Can we send object using Sockets 243.Can we write bussiness methods in servlets? if yes, then how can u access th at from out side of the servlets? 244.Did you set up a workflow? Are you familiar with all steps for setting up a workflow? 245.Difference between abstract class and interface 246.Difference between JDBC and Hibernate?Give one sample based on the variance?

You might also like