Java 2 Programmer Exam Cram 2

Similar documents
Sams Teach Yourself Java 2 in 21 Days, Fourth Edition. Copyright 2004 by Sams Publishing. International Standard Book Number:

A+ Exam Cram 2. Copyright 2003 by Que Publishing. International Standard Book Number: Warning and Disclaimer

Zend PHP Certification Study Guide. Copyright 2005 by Sams Publishing. International Standard Book Number: Warning and Disclaimer

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Points To Remember for SCJP

1 Shyam sir JAVA Notes

CCNA Practice Questions Exam Cram 2. Copyright 2004 by Que Publishing. International Standard Book Number: Warning and Disclaimer

Computational Expression

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA

Eclipse Kick Start. Copyright 2005 by Sams Publishing. International Standard Book Number:

Java Primer 1: Types, Classes and Operators

MCAD/MCSD Developing and Implementing Web Applications with Visual Basic.NET and Visual Studio.NET Training Guide: Exam

Sams Teach Yourself ASP.NET in 24 Hours

Sams Teach Yourself ASP.NET in 24 Hours

Casting -Allows a narrowing assignment by asking the Java compiler to "trust us"

Java Overview An introduction to the Java Programming Language

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Data Types, Variables and Arrays. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Lab5. Wooseok Kim

JAVA MOCK TEST JAVA MOCK TEST III

Compaq Interview Questions And Answers

1/16/2013. Program Structure. Language Basics. Selection/Iteration Statements. Useful Java Classes. Text/File Input and Output.

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA

Programming with Java

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

OS06: Monitors in Java

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Training topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives

Java Threads and intrinsic locks

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

The Sun s Java Certification and its Possible Role in the Joint Teaching Material

Special Topics: Programming Languages

Java Threads. COMP 585 Noteset #2 1

Use the scantron sheet to enter the answer to questions (pages 1-6)

Definition of DJ (Diminished Java)

Selected Questions from by Nageshwara Rao

CSC Java Programming, Fall Java Data Types and Control Constructs

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

The Ruby Way. Copyright 2003 by Que Publishing. International Standard Book Number: Warning and Disclaimer

CCNA Security Official Cert Guide First Edition. Copyright 2015 Cisco Systems, Inc. ISBN-10: ISBN-13:

Modern Programming Languages. Lecture Java Programming Language. An Introduction

Core Java Interview Questions and Answers.

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

An Introduction to Processing

CMSC 433 Section 0101 Fall 2012 Midterm Exam #1

Name Return type Argument list. Then the new method is said to override the old one. So, what is the objective of subclass?

Full file at

Identifiers and Variables

Java Identifiers, Data Types & Variables

Objects and Iterators

The Object Class. java.lang.object. Important Methods In Object. Mark Allen Weiss Copyright 2000

Concurrent and Real-Time Programming in Java

Computer Programming, I. Laboratory Manual. Final Exam Solution

UMBC CMSC 331 Final Exam

Operators and Expressions

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension.

Prelim 1 Solutions. CS 2110, March 10, 2015, 5:30 PM Total Question True False. Loop Invariants Max Score Grader

CS260 Intro to Java & Android 03.Java Language Basics

The Java Language The Java Language Reference (2 nd ed.) is the defining document for the Java language. Most beginning programming students expect

c) And last but not least, there are javadoc comments. See Weiss.

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

CSE 501N Final Fall Points Possible

The Java Programming Language

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Values and Variables 1 / 30

Zheng-Liang Lu Java Programming 45 / 79

JAVA MOCK TEST JAVA MOCK TEST II

CMSC131. Inheritance. Object. When we talked about Object, I mentioned that all Java classes are "built" on top of that.

VARIABLES AND TYPES CITS1001

boolean, char, class, const, double, else, final, float, for, if, import, int, long, new, public, return, static, throws, void, while

Mustang Wiring & Vacuum Diagrams

3. Java - Language Constructs I

CSCI 136 Written Exam #1 Fundamentals of Computer Science II Spring 2014

MCS-378 Intraterm Exam 1 Serial #:

1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A.

CS 3360 Design and Implementation of Programming Languages. Exam 1

Total Score /1 /20 /41 /15 /23 Grader

The New Java Technology Memory Model

INHERITANCE. Spring 2019

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit

AIS Cube [THE BLAZINGCORE SERIES] LANGUAGE REFERENCE

CSE115 / CSE503 Introduction to Computer Science I. Dr. Carl Alphonce 343 Davis Hall Office hours:

Declarations and Access Control SCJP tips

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

CMPS 134: Computer Science I Fall 2011 Test #1 October 5 Name Dr. McCloskey

Java Modifiers Matrix

THE CONCEPT OF OBJECT

Concurrent Programming using Threads

MCSE Windows 2000 Network Infrastructure Training Guide Exam (70-216) Dave Bixler, Larry Chambers, and Joseph Phillips

2 rd class Department of Programming. OOP with Java Programming

CGS 3066: Spring 2015 JavaScript Reference

Practice exam for CMSC131-04, Fall 2017

BITDEFENDER HERE GENERIC COURSES. Training Certifications

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended

Transcription:

Java 2 Programmer Exam Cram 2 Copyright 2003 by Que Publishing International Standard Book Number: 0789728613 Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an "as is" basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the CD or programs accompanying it. When reviewing corrections, always check the print number of your book. Corrections are made to printed books with each subsequent printing. To determine the print number of your book, view the copyright page. The print number is the right-most number on the line below the "First Printing" line. For example, the following indicates that this is the 1 st printing of this title. First Printing: March 2003 06 05 04 03 4 3 2 1

First Printing Corrections Pg Error Correction Cram Sheet 6. protected Only methods in the same package or in subclasses can access protected class members. This keyword is not applied to classes. private Only methods in the same class can access a private member. This key word is not applied to classes. 6. protected Only methods in the same package or in subclasses can access protected class members. This keyword is not applied to normal (non-tested) classes. private Only methods in the same class can access a private member. This key word is not applied to normal (non-tested) classes. 15 4 th paragraph, 1 st sentence You can import an entire group of classes in a package using the familiar wildcard * to simply any class name, 4 th paragraph, 1 st sentence You can import an entire group of classes in a package using the familiar wildcard * to represent any class name, 18 Last paragraph, 1 st sentence Last paragraph, 1 st sentence An identifier can begin with a letter, a dollar sign ($), or an underscore character (_). 39 1 st paragraph, 2 nd sentence 69 Alert This rule can be important if the left operand is a method call or an expression that modifies a variable that appears on the right. With reference variables, final means An identifier can begin with a letter, a dollar sign ($) or another Unicode currency symbol, or an underscore (_). 1 st paragraph, 2 nd sentence This rule can be important if the left operand invokes a method call or an expression that modifies a variable that appears on the right. Alert (text added) With reference variables, final means that

that the initial object reference cannot be replaced by another object reference not that the object itself cannot be modified. 79 2nd paragraph, last sentence All methods in an interface are implicitly abstract. 91 Last paragraph, 2nd sentence The operation of the BubTimer as an extension of thread is discussed in Chapter 10... 103 Bottom paragraph 1st line Answer D is correct. t shows 158 Last paragraph, 3rd line Answer B is incorrect because the keyword needed is throw; throw is used in method declarations. 193 2nd paragraph, 2nd sentence It is possible to attach more than one thread to a runnable object. 200 Last sentence If a thread that has a lock on one or the initial object reference cannot be replaced by another object reference not that the object itself cannot be modified. Instance variables declared final must have a value set during construction of the instance. 2nd paragraph, last sentence All methods in an interface are implicitly abstract and public. Last paragraph, 2nd sentence The operation of the BubTimer as an extension of Thread is discussed in Chapter 10... Bottom paragraph 1st line Answer D is correct. It shows Last paragraph, 3rd line Answer B is incorrect because the keyword needed is throw; throws is used in method declarations. 2nd paragraph, 2nd sentence It is possible to attach more than one thread to a Runnable object. Last sentence If a thread that has a lock on one or more

more objects dies, the JVM removes the locks and does the equivalent of notifyall for each object locked. 215 2nd bullet at top of page The pow method This method takes two values as arguments and returns the value of the first argument raised to the power of the second argument. 230 1st paragraph 1st sentence under the heading "The Hashtable Object" The hashtable classis designed to store... 235 Paragraph before the last code sample If the class implements the Map interface, the Iterator method is not directly available, but can be obtained indirectly by calling the keyset method, as follows: 242 Option C The default implementation of equals is to return the memory address of the object. 273 Question 12 12. A, B objects dies, the JVM removes the locks. and does the equivalent of notifyall for each object locked. 2nd bullet at top of page The pow method This method takes two values as arguments and returns the value of the first argument raised to the power of the second argument. The arguments and return values are double primitives. 1st paragraph 1st sentence under the heading "The Hashtable Object" The hashtable class is designed to store... Paragraph before the last code sample If the class implements the Map interface, the iterator method is not directly available, but can be obtained indirectly by calling the keyset method, as follows: Option C The typical default implementation of hashcode is to return the memory address of the object. Question 12 12. A, B, D

274 Question 44 44. D, E 275 Answer 5, 2nd sentence Answer B is correct. The compiler error message in Public class Base must be defined in a file called Base.java. 276 Answer 12, 1st sentence Answers A and B are correct. 282 Answer 44, 1st sentence 315 Key 23 Answers D and E are correct. 16. B 23. A, C 317 Answer 5 Answer B is correct. Answer A is incorrect because the Boolean array is constructed with default values of false. Answer C is incorrect; it cannot occur because the special value null is used only with objects and this is a primitive reference. Answer D is incorrect; it does not occur because this is a legal way to Question 44 44. B, E Answer 5, 2nd sentence Answer B is correct. The compiler error message is: Public class Base must be defined in a file called Base.java. Answer 12, 1st sentence Answers A, B, and D are correct. Answer 44, 1st sentence Answers B and E are correct. Key 23 16. B, D 23. A Answer 5 Answer B is correct. Answer A is incorrect because the boolean array is constructed with default values of false. Answer C is incorrect; it cannot occur because the special value null is used only with objects and this is a primitive reference. Answer D is incorrect; it does not occur because this is a legal way to construct a member variable array of boolean primitives.

construct a member variable array of Boolean primitives. 318 Answer 15, last sentence Answers C and D are incorrect because both have to be selected and then asked for the minimum change. 320 Answer 23, 1st sentence Answers A and C are correct. Answer 23, 3rd sentence Answer C is correct because when extending a class that has a finalize method, you must write a finalize that executes super.finalize(). 320 Answer 26, 5th sentence Answer D is incorrect because only constants can appear in a switch statement. variable array of boolean primitives. Answer 15, last sentence Answers C and D are incorrect because both have to be selected and the question asked for the minimum change. Answer 23, 1st sentence Answer A is correct. Answer 23, 3rd sentence Answer C is incorrect because if you do not write a finalize method, the super.finalize() will be called. Answer 26, 5th sentence Answer D is incorrect because only constants can appear in a case statement.