Archives
Programming Languages Appendix I Declaring And Creating Scanner Obtain User input From
ANS: a. Two forward slashes ( // ). ANS: a. my Value (Identifiers may not contain blanks). ANS: d. An extra blank line. ANS: c. System.out.println( “Hello world!” ); Compiling and Executing Your First Java Application ANS: b. javac Welcome.java […]
Programming Languages Chapter 01 Which of the following is most closely associated
ANS: d. In use today are more than a trillion general-purpose computers and trillions more Java-enabled cellphones, smartphones and other handheld devices. ANS: c. Enterprise Edition. Section 1.2 Computers: Hardware and Software ANS: c. Unfortunately, silicon is expensive, so it […]
Programming Languages Chapter 03 Classes often provide public methods to allow
ANS: d. type. ANS: c. extensible. Section 3.2.1 Account Class with an Instance Variable, a set Method and a get Method ANS: a. Each class declaration that begins with the access modifier private must be stored in a file that […]
Programming Languages Chapter 03 java indicates that all files in the current
ANS: d. type. ANS: c. extensible. Section 3.2.1 Account Class with an Instance Variable, a set Method and a get Method ANS: a. Each class declaration that begins with the access modifier private must be stored in a file that […]
Programming Languages Chapter 06 Which of the following can be an argument to a method
ANS: d. the arguments to the method. ANS: d. performs a single, well-defined task. Section 6.3 static Methods, static Fields and Class Math ANS: b. the return type ANS: c. Math.sqrt(900); ANS: c. parseInt ANS: d. All of the above. […]
Programming Languages Chapter 07 Consider Array Items Which Contains The
Ans: b. A, B, D. © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc. Ans: c. 9. Chapter 7 Arrays and ArrayLists Section 7.1 Introduction 7.1 Q1: Arrays are ________. a. variable-length entities b. fixed-length entities c. […]
Programming Languages Chapter 08 What happens when this is used in a constructor
ANS: b. format. ANS: c: Clients are usually involved in a class’s implementation. Section 8.3 Controlling Access to Members ANS: c. Variables (or fields). ANS: a. Methods and instance variables can both be either public or private. Section 8.4: Referring […]
Programming Languages Chapter 09 After The Constructor For Class Executes The
ANS: d. is-a relationship Section 9.2 Superclasses and Subclasses ANS: c. Sailboat/Tugboat. A Sailboat is not a superclass for Tugboats. Both sailboat and tugboats would be subclasses of Boat. ANS: c. Objects of a subclass can be treated like objects […]
Programming Languages Chapter 1 Logic Errors Have Effects Execution Timed Logic
ANS: d. All of the above. Section 4.4 Control Structures ANS: b. Shorter ANS: d. Declaration structure. Sequence Structure in Java ANS: c. Rectangle with left and right sides replaced with arcs curving outward. © Copyright 1992-2015 by Deitel & […]
Programming Languages Chapter 10 A superclass reference can be assigned to a
Ans: c. A program to compute a 5% savings account interest for a variety of clients. Because there is only one kind of calculation, there is no need for polymorphism. © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson […]
Programming Languages Chapter 11 The try block must be followed by at least
Ans: b. thrown. Ans: d. Instructions on handling the exception. © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc. Ans: a. It specifies the point at which the exception must be handled. Section 11.3 Example: Handling Chapter […]
Programming Languages Chapter 12 Which of the following is not a GUI component
Ans: c. Menu bar. (No questions.) JOptionPane Ans: d. showInputDialog. © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc. Chapter 12: GUI Components: Part 1 12.1 Introduction 12.1 Q1: Which of the following is not a GUI […]
Programming Languages Chapter 13 Draws a filled oval with its leftmost point
Ans: a. drawing is performed differently on every platform that supports Java. A subclass of Graphics must be created that uses the drawing capabilities of the current platform. Ans: b. C, D, E. Section 13.3 Color Control © Copyright 1992-2015 […]
Programming Languages Chapter 14 Which of the following creates the string
ANS: d. C and D. ANS: b. is a string literal. Section 14.3 Class String Section 14.3.1 String Constructors ANS: b. int arrays. ANS: c. Cannot be changed. Section 14.3.2 String Methods length, charAt and getChars ANS: a. The String […]
Programming Languages Chapter 15 Class Scanner Does Not Provide The Ability
ANS: d. Formatter ANS: c. They redirect the standard input, output and error streams. ANS: b. byte-based streams Directory Information © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc. Chapter 15: Files, Streams and Object Serialization 15.1 […]
Programming Languages Chapter 16 Class Collections Provides Algorithms For Reversing
ANS: d. The number of pages in a book. Section 16.2 Collections Overview ANS: c. Collections discourage software reuse because they are non-portable. Actually, they encourage software reuse because they are portable. ANS: a. java.util. Section 16.3 Type-Wrapper Classes ANS: […]
Programming Languages Chapter 17 Java supported three programming paradigms
ANS:c. Lambda. ANS: b. Using a loop to iterate over a collection of elements is known as external iteration and requires accessing the elements sequentially. Such iteration also requires mutable variables. External iteration is easier to parallelize. Actually, internal iteration […]
Programming Languages Chapter 18 can be called indirectly through another method
Ans: a. base case(s). Ans: c. the original call to the method is still active. Ans: c. Both a and b. © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc. Chapter 18: Recursion 18.1 Introduction 18.1 Q1: […]
Programming Languages Chapter 19 The worst case in linear search is that every
ANS: d. All of the above. Section 19.2 Linear Search ANS: b. 10. Efficiency of Linear Search ANS: b. Variable run time. ANS: c. O(n). Section 19.3 Big O Notation Ans: c. an algorithm’s efficiency in terms of the work […]
Programming Languages Chapter 2 Neither A Nor B True ans Neither A
ANS: a. int. Section 5.3 for Repetition Statement ANS: c. Both (a) and (b) are true. © Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc. Chapter 5 Control Statements: Part 2 Section 5.2 Essentials of Counter-Controlled Repetition […]
Programming Languages Chapter 20 Overloaded methods are often used to perform
ANS: c. Generic methods. ANS: a. compile-time type safety. Section 20.2 Motivation for Generic Methods ANS: c. Both a) and b). Section 20.3 Generic Methods: Implementation and Compile– Time Translation ANS: b. angle brackets (< and >). ANS: b. Each […]
Programming Languages Chapter 21 The Class path Consists List Directories Archive
ANS: c. Insertions and deletions are made only at one end of a queue, its tail. Actually, in a queue, insertions are made at the tail and deletions are made at the head. Section 21.2 Self-Referential Classes ANS: d. Self-referential. […]
Programming Languages Chapter 23 Other Threads Attempting Perform An operation That
ANS: b. in parallel ANS: b. Concurrency is a subset of parallelism. Actually, parallelism is a subset of concurrency. ANS: c. Multithreading can increase performance only on multi-core systems. Actually, multithreading can also increase performance on single-processor systems—when one thread […]
Programming Languages Chapter 24 Java programs communicate with databases
ANS: b. JDBC. ANS: b. Allows developers to change the underlying database without modifying the Java code. Section 24.2 Relational Databases ANS: b. query. ANS: a. Identifies each row of a table. Section 24.3 A books Database ANS: a. Foreign […]
Programming Languages Chapter 25 The Space Between Nodes Contents
ANS: d. Java’s GUI, graphics and multimedia API of the future is Swing. Actually, Java’s GUI, graphics and multimedia API of the future is JavaFX. Section 25.2 JavaFX Scene Builder and the NetBeans IDE ANS: c. The FXML code is […]