Right Place For Right PersonTM |
Sponsored Ads |
Technical Interview Questions Sun JAVA2 Certification Program Volume 1.1
Question 1.Which
of the following are valid declarations? Assume Answers: A, B, D. The angle-bracket notation is part of release 5.0’s generic collections. Question 2.You can determine all the keys in a Map in which of the following ways?
A. By getting a Set
object from the Map and iterating through it. Answers A. A Map contains a Set, which is a list that does not allow duplicates. Once you acquire the Set you can iterate through the keys. Question 3.What keyword is used to prevent an object from being serialized?
A.private Answers D. By placing the keyword transient before an object’s declaration, that value will not be included with the serialized data of the parent object. Question 4.An abstract class can contain methods with declared bodies.
A.True Answers A. Abstract classes can contain methods that are defined and methods that are not defined. Question 5.Select the order of access modifiers from least restrictive to most restrictive.
A.public,private,protected, default Answers E. The public access modifier means the element is available to all; protected lets those within the class, package, or subclass gain access to the element. The lack of a modifier, that is ,“default,” means that it is accessible only within the package. Finally, private is the most restrictive and provides access within the class only. Question 6.Which access modifier allows you to access method calls in libraries not created in Java?
A public Answers C. The native modifier is an indicator to the Java Virtual Machine that the method actually lives in a library outside of Java. The System.loadLibrary() method is required to indicate which library contains the method. Question 7. Which of the following statements are true? (Select all that apply.) A. A final object’s data cannot be changed. B. A final class can be subclassed. C. A final method cannot be overloaded. D. A final object cannot be reassigned a new address in memory. E. None of the above. Answers D. An object denoted as final can have its data changed; however, the address location is what is determined as unchangeable. The third statement is false because a final method means it cannot be overridden, and the second statement is false because a final class means it cannot be subclassed. Question 8. The keyword extends refers to what type of relationship?
A. “is a” Answers A. The keyword extends is used when referring to another class. The extending class will have all access to all the available methods in the extended class, and the methods may be called as though they are defined in the extending class. If the extending class defines a method that exists in the extended class, that method is said to be overridden in the extending class. Because the extending class does not have to define any of the methods available in the extended class, it is said that the subclass X “is a” Y. Question 9. Which of the following keywords is used to invoke a method in the parent class?
A. this Answers B. The super keyword is used to invoke a method or constructor in a parent class. Question 10. Given the following code, what will be the outcome?
public class Funcs
extends java.lang.Math { Funcs f = new Funcs(); System.out.println("" + f.add(1, 2)); } } A. The code compiles but does not output anything. B. “3” is printed out to the console. C. The code does not compile. D. None of the above. Answers C. The code does not compile because it extends the Math class, which has been declared as final. A class cannot extend a class that has been declared final.
|
Sponsored Ads Sponsored Ads Sponsored Ads Sponsored Ads Sponsored Ads |
Interview Questions And Answers
Struts interview questions and answers (Subjective) 500 Java Objective Questions and Answer Core Java Objective Questions And Answers Core Java Subjective Questions And Answers Core Java Interview Questions And Answers Core Java Interview Questions and Answers (Subjective) Core Java Interview Questions and Answers( Objective) 50 Servlet interview questions 155 Java Interview Questions EJB Interview Questions and Answers(Subjective) R4R,JSP Interview Questions and Answer(Subjective) R4R,Java Servlets Interview Questions and Answers(Subjective) Core Java Subjective ,Objective and Interview Questions And Answers 275 Core java interview questions Java Objective Questions and Answer Java Architect Interview Questions Applet Interview Questions and Answers Core Java example Servlet Objective Questions And Answers Servlet Subjective Questions And Answers Servlet Interview Questions And Answers JSP Objective Questions And Answers JSP Subjective Questions And Answers JSP Interview Questions And Answers JDBC Objective Questions And Answers JDBC Subjective Questions And Answers JDBC Interview Questions And Answers JDBC Interview questions and answers Networking Interview questions and answers Servlets Interview questions and answers EJB Objective Questions And Answers EJB Subjective Questions And Answers EJB Interview Questions And Answers Hibernate Objective Questions And Answers Hibernate Subjective Questions And Answers Hibernate Interview Questions And Answers Spring Objective Questions And Answers Spring Subjective Questions And Answers Spring Interview Questions And Answers Struts Objective Questions And Answers Struts Subjective Questions And Answers Struts Interview Questions And Answers Ant Objective Questions And Answers Ant Subjective Questions And Answers Ant Interview Questions And Answers PHP Objective Questions And Answers PHP Subjective Questions And Answers PHP Interview Questions And Answers 1 ASP.net Objective Questions And Answers ASP.net Subjective Questions And Answers ASP.net Interview Questions And Answers 1 ASP.net interview questions ,ASP.net interview answers,ASP.net interview questions and answers PHP interview questions ,PHP interview answers,PHP interview questions and answers Testing Objective Questions And Answers Testing Subjective Questions And Answers Testing Interview Questions And Answers Ajax Tutorials Ajax Objective Questions And Answers Ajax Subjective Questions And Answers Ajax Interview Questions And Answers Linux Objective Questions And Answers Linux Subjective Questions And Answers Unix Subjective Questions And Answers Unix Interview Questions And Answers HR interview questions and answers HR Interview Questions Tips HR Objective Questions And Answers HR Subjective Questions And Answers HR Interview Questions And Answers Learn C Language with in a day C /C++ Questions C Objective Questions And Answers C Subjective Questions And Answers C Interview Questions And Answers C Objective Interview Questions And Answers(10) C Subjective Interview Questions And Answers(100) C syntax,semantics and simple programming questions(61) Linux Interview Questions And Answers Unix Objective Questions And Answers C Aptitude Questions(179) C++ Interview Questions And Answers C++ Objective Questions And Answers C++ Subjective Questions And Answers C++ Interview Questions And Answers C,C++ objective Interview Questions and answers C Interview Questions And Answers( Objective and Subjective) C Objective Interview Questions And Answers(10) C Subjective Interview Questions And Answers(100) C,C++ Interview Questions 35 C++ Interview Questions And Answers(Subjective) 109 C++ Interview Questions Java Script Interview Question and Answer(1-10). Java Script Interview Question and Answer(11-20). Java Script Interview Question and Answer(21-30). Java Script Interview Question and Answer(31-40). Javascript Objective Questions And Answers Javascript Subjective Questions And Answers Javascript Interview Questions And Answers MFC Interview Questions And Answers(Subjective) MFC Interview Questions And Answers(Subjective) ATL Interview Questions And Answers(Subjective) COM DCOM Interview Questions And Answers(Subjective) Win32API Interview Questions And Answers(Subjective) ActiveX Interview Questions And Answers(Subjective) R4R, VC++ AllOther Interview Questions And Answers(Subjective) PL/SQL Interview Questions And Answers(Subjective) 152 PL/SQL Interview Questions And Answers(Subjective) Asp Objective Questions And Answers Asp Subjective Questions And Answers Asp Interview Questions And Answers 1 VB Objective Questions And Answers | |||||||
| Comments: Give Your Comments: Advertiser PRIVACY POLICY ||User PRIVACY POLICY || R4R Group Srvices |