Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Java Questions 1

Java Questions 1

Ratings: (0)|Views: 560|Likes:
Published by msapozhnikov
Java Interview Questions
Java Interview Questions

More info:

Published by: msapozhnikov on Mar 07, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





Java Questions
1. Which of the following statements are correct? [Select all correct answers]1.Array indexes in Java always start at 0.2.An instance variable declared in a class is created when an instance of theclass is created.3.An instance variable declared in a class is created the first time an instance of the class is accessed.4.When an object is created, any instance variables which have not beenassigned a value remain undefined.5.The
primitive types are also known as literals.2. Which of the following are not Java keywords? [Select all correct answers]1.extern2.long3.elsi4.case3. Its not just Stateless Session Beans that are pooled, Entity Beans are as well.True/False?1.True2.False4. Which of the following methods are invoked on a stateless session bean when it is inthe method ready pool?1.ejbCreate2.ejbActivate3.ejbPassivate4.setSessionContext5.unsetSessionContext6.business methods7.ejbRemove 5. What is the output of the following code?
1: String str = "Welcome";2:3: str.concat(" to Java!");4:5: System.out.println(str);
A) Strings are immutable, compilation error at line 3.B) Strings are immutable, runtime exception at line 3.C) Prints "Welcome".D) Prints "Welcome to Java!".6. A class design requires that a particular member variable must be accessible for directaccess by any subclasses of this class, otherwise not by classes which are not members of the same package. What should be done to achieve this?A. The variable should be marked publicB. The variable should be marked privateC. The variable should be marked protected
D. The variable should have no special access modifier E. The variable should be marked private and an accessor methodprovided7. The following declaration (as a member variable) is legalstatic final transient int _MaxElements = 100;A) True.B) False.8. What is default layout manager for panels and applets?A) FlowlayoutB) GridlayoutC) BorderLayout9. Which of the following statements contains an error?A.SELECT * FROM emp WHERE empid = 345678;B.SELECT empid FROM emp WHERE empid = 345678;C.SELECT empid FROM emp;D.SELECT empid WHERE empid = 345678 AND lastname=’SMITH’;10. Which statements are true about the collection interfaces?1.Set extends Collection2.All methods defined in Set are also defined in Collection
3.List extends Collection4.All methods defined in List are also defined in Collection5.Map extends Collection11. Choose the legal array declarations.1.int a [];2.int [] a;3.int [4] a [];4.int a [5];5.int [] a [] [];12. Which of the following statements regarding a web application deployed on J2EEserver are true? Select three choices.1.The configuration information is maintained in an XML file called webapplication deployment descriptor.2.The web components are packaged in a file with war as an extension.3.The web components are packaged in a file with jar as an extension.4.The web application packages can be created using the war utility.5.The web application packages can be created using jar utility.13. You have been given a design document for a veterinary registration system for implementation in Java technology. It states:"A pet has an owner, a registration date, and a vaccination-due date. A cat is a pet thathas a flag indicating if it has been neutered, and a textual description of its markings."Given that the Pet class has already been defined, which of the following fields would beappropriate for inclusion in the Cat class as members?A.Pet thePet;B.Date registered;C.Date vaccinationDue;D.Cat theCat;E.boolean neutered;F.String markings;14. Consider the following classes, declared in separate source files:1. public class Base {2. public void method(int i) {3. System.out.println("Value is " + i);4. }5. }1. public class Sub extends Base {2. public void method(int j) {3. System.out.println("This value is " + j);4. }5. public void method(String s) {

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->