SCJP 16 PDF eBook Exam Questions

Click here to load reader

  • date post

    18-Nov-2014
  • Category

    Documents

  • view

    184
  • download

    6

Embed Size (px)

description

this is a book related to scjp test

Transcript of SCJP 16 PDF eBook Exam Questions

SCJP Mock Exams by JavaChamp.comOpen Certification Plattformhttp://www.JavaChamp.com

Authors: N. Ibrahim, Y. Ibrahim

Copyright (c) 2009

Introducing JavaChamp.com WebsiteJavaChamp.com is a Java Open Certification Plattform. It provides an interactive web interface for the Java community to learn, interact and certify its acquired java experience. JavaChamp.com helps the Java developers to achieve the highest impact of thier learning activities. Start JavaChamp.com online exams now and prepare yourself for the next interview or certification! Visit http://www.JavaChamp.com

(2) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

(3) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

CopyrightCopyright 2009 JavaChamp.com Online version published by JavaChamp.com Germany. DISCLAIMER All services and content of JavaChamp.com are provided under JavaChamp.com terms of use on an "as is" basis, without warranty of any kind, either expressed or implied, including, without limitation, warranties that the provided services and content are free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the provided services and content is with you. In no event shall JavaChamp.com be liable for any damages whatsoever arising out of or in connection with the use or performance of the services. Should any provided services and content prove defective in any respect, you (not the initial developer, author or any other contributor) assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty constitutes an essential part of these "terms of use". No use of any services and content of JavaChamp.com is authorized hereunder except under this disclaimer. The detailed "terms of use" of JavaChamp.com can be found under: http://www.javachamp.com/public/termsOfUse.xhtml This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 license. The full license legal code can be found under: http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode And a human-readable summary of the this license can be found under: http://creativecommons.org/licenses/by-nc-nd/3.0/ According to the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 license You agree to the following: You are free to share, copy, distribute and transmit the work under the following conditions: You must attribute the work to JavaChamp.com with a link to http://www.javachamp.com. You may not use this work for commercial purposes. You may not alter, transform, or build upon this work.

(4) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

JavaChamp CompetitionCompetition Details JavaChamp.com offers you the chance to win a 50$ Amazon Gift Card by contributing to JavaChamp.com question bank. Competition description: The competition revolves about contributing to JavaChamp.com question bank. You can contribute questions in different IT subjects such as Java, Html, SQL, CSS, etc. How to participate in the competition: * To be able to participate in the competition you have to be a registered member in our community. * You can contribute by submitting questions in any of IT subjects (Java, JSF,EJB,...) * Having a JavaChamp Public Profile is optional but will earn you some extra points in the competition final round. How to qualify: * Questions submitted must be correct (in technical content and language) * Questions submitted must conform to our Terms of use * Minimum number of questions to qualify for this competition is 30 questions * JavaChamp.com team will discard any low quality or duplicated question How to win: After sifting the competitors to end up with the qualifiers, JavaChamp.com team will choose the winner based on not only the number of questions submitted but also with the quality and originality of questions. Competition Prize: The prize is a 50$ Amazon Gift Card which will be delivered to the winner by the appropriate means. The winner's name will be posted in our website and will be marked accordingly in her/his public profile.

(5) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

Table of Contents1. Java Programming Language - Strings - Constructors - Inner class - Flow Control - Declarations and Access Control - Interfaces and Abstract Classes - Exceptions - Inheritance - Arrays - Operators - Variables and Methods - Wrappers and Autoboxing - Garbage Collection - Overriding and Overloading - Collections - Generics - Formatting - I/O - Threads - Enums - Data Types - Static and init blocks - Serialization 2. C Programming Language - Basics - Arithmetic operators - Logical operators and Conditions - Print out Statements - Flow Control - Inputs Reading - Assignement - Arrays - Methods and Functions - Identifiers and Variables - Data Types - Strings 3. Assembly Programming Language - Basics

(6) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

(7) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1. Chapter: Java Programming Language Chapter Description and Objectives1. StringsExam Category Description and Objectives

1.1.1. Java objects comparisonWhat is the expected output?

public static void main(String[] args) { boolean stmt1 = "champ" == "champ"; boolean stmt2 = new String("champ") == "champ"; boolean stmt3 = new String("champ") == new String("champ"); System.out.println(stmt1 && stmt2 || stmt3); } Please choose only one answer:

true false

Check this Question online on JavaChamp.com: Java objects comparison

JavaChamp.com Competition: Win 50$ Amazon Gift Card Check the competition details and be the Champ!

(8) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1.1.2. How to compare java objects?What is the expected output?

public static void main(String[] args) { boolean stmt1 = "champ" == "champ"; boolean stmt2 = new String("champ").equals(new String("champ")); boolean stmt3 = "champ".toString()=="champ"; System.out.println(stmt1 && stmt2 && stmt3); } Please choose only one answer:

true false

Check this Question online on JavaChamp.com: How to compare java objects?

JavaChamp.com Competition: Win 50$ Amazon Gift Card Check the competition details and be the Champ!

(9) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1.1.3. What are common methods between String and StringBuffer?Select the common methods, which are defined for both type String and type StringBuffer ? Please choose all the answers that apply:

toString() length() append(String) trim() equals(Object)

Check this Question online on JavaChamp.com: What are common methods between String and

StringBuffer?

JavaChamp.com Competition: Win 50$ Amazon Gift Card Check the competition details and be the Champ!

(10) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1.1.4. What is the difference between String and StringBuffer?Which of the statements would evaluate to true?

public class Tester { public static void main(String[] args) { StringBuffer sb = new StringBuffer("javachamp"); String s = new String("javachamp"); boolean stmt1 = s.equals(sb) ; boolean stmt2 = sb.equals(s) ; boolean stmt3 = sb.toString() == s ; boolean stmt4 = sb.toString().equals(s) ; boolean stmt5 = s.equals(sb.toString()) ; } } Please choose all the answers that apply:

stmt1 stmt2 stmt3 stmt4 stmt5

Check this Question online on JavaChamp.com: What is the difference between String and StringBuffer?

JavaChamp.com Competition: Win 50$ Amazon Gift Card Check the competition details and be the Champ!

(11) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1.1.5. Comparing String and StringBuffer in javaWhich of the statements would evaluate to true?

public class Tester { public static void main(String[] args) { StringBuffer sb1 = new StringBuffer("javachamp"); StringBuffer sb2 = new StringBuffer("javachamp"); boolean stmt1 =sb1.equals(sb2) ; boolean stmt2 = sb1 == sb2; String s1 = new String("javachamp"); String s2 = new String("javachamp"); boolean stmt3 = s1.equals(s2); boolean stmt4 = s1 == s2; } } Please choose all the answers that apply:

stmt1 stmt2 stmt3 stmt4

Check this Question online on JavaChamp.com: Comparing String and StringBuffer in java

JavaChamp.com Competition: Win 50$ Amazon Gift Card Check the competition details and be the Champ!

(12) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1.1.6. Concatenating String and nullWhat is the expected output?

public static void main(String args []) { String stmt = null; System.out.print(null+stmt); System.out.print(stmt+null); } Please choose only one answer:

RuntimeException is thrown because of the first print statement RuntimeException is thrown because of the second print statement nullnullnullnull nullnull compilation error

Check this Question online on JavaChamp.com: Concatenating String and null

JavaChamp.com Competition: Win 50$ Amazon Gift Card Check the competition details and be the Champ!

(13) JavaChamp.com SCJP Mock Exams - Copyright 2009 all rights reserved

1.1.7. Comparing StringBuffer using equals in javaWhat is the result of compiling and running the following code?

public static void main(String[] args) { StringBuffer buffer1 = new StringBuffer("javachamp"); StringBuffer buffer2 = new StringBuffer(buffer1); if (buffer1.equals(buffer2)) System.out.println("true"); else System.out.println("false"); } Please choose only one answer:

true false

Check this Question online on JavaChamp.c