Deck 5: Defining Classes Ii
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/46
العب
ملء الشاشة (f)
Deck 5: Defining Classes Ii
1
A copy constructor has _________ parameters.
(a)zero
(b)one
(c)two
(d)three
(a)zero
(b)one
(c)two
(d)three
B
2
All of these are methods of Java's Math class except:
(a)pow
(b)min
(c)random
(d)toString
(a)pow
(b)min
(c)random
(d)toString
D
3
The program included in the Java SDK that allows a programmer to separate the class interface from the class implementation is called:
(a)javac
(b)java
(c)javadoc
(d)none of the above
(a)javac
(b)java
(c)javadoc
(d)none of the above
C
4
A class that contains public methods that can change the data in the object of a class is called a/an:
(a)mutable class
(b)immutable class
(c)invariant class
(d)none of the above
(a)mutable class
(b)immutable class
(c)invariant class
(d)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
5
The method trim of the String class trims off:
(a)Leading white space
(b)Trailing white space
(c)Leading and trailing white space
(d)Blanks
(a)Leading white space
(b)Trailing white space
(c)Leading and trailing white space
(d)Blanks
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
6
To create a package,you must add a package statement at the ____________ of each class file.
(a)beginning
(b)end
(c)before each method signature
(d)after the import statements
(a)beginning
(b)end
(c)before each method signature
(d)after the import statements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
7
The Math method that returns the nearest whole number that is greater than or equal to its argument is:
(a)round
(b)ceil
(c)floor
(d)all of the above
(a)round
(b)ceil
(c)floor
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
8
A main method can be placed inside a class definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
9
In a static method,you may use the this parameter either explicitly or implicitly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
10
An example of secondary memory is:
(a)RAM
(b)ROM
(c)hard disk
(d)all of the above
(a)RAM
(b)ROM
(c)hard disk
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
11
Static variables are often used:
(a)in arithmetic expressions
(b)to communicate between objects
(c)within looping structures
(d)all of the above
(a)in arithmetic expressions
(b)to communicate between objects
(c)within looping structures
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
12
A condition that allows a programmer to circumvent the private modifier and change the private instance variable is called:
(a)a copy constructor
(b)a privacy leak
(c)a class invariant
(d)an anonymous object
(a)a copy constructor
(b)a privacy leak
(c)a class invariant
(d)an anonymous object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
13
Javadoc requires a comment to be delimited by _________ to be included in the extracted class interface.
(a)// //
(b)/* */
(c)/** */
(d)" "
(a)// //
(b)/* */
(c)/** */
(d)" "
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
14
The conversion from an object of a wrapper class to a value of its associated primitive type is called:
(a)Boxing
(b)Unboxing
(c)Converting
(d)Reinstantiating
(a)Boxing
(b)Unboxing
(c)Converting
(d)Reinstantiating
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
15
null can be used:
(a)to indicate a variable has no real value
(b)in a Boolean expression with ==
(c)as a placeholder
(d)all of the above
(a)to indicate a variable has no real value
(b)in a Boolean expression with ==
(c)as a placeholder
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
16
When you use the assignment operator with variables of a class type,you are assigning a:
(a)value
(b)primitive type
(c)local variable
(d)reference
(a)value
(b)primitive type
(c)local variable
(d)reference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
17
A static method is one that can be used with a _____________.
(a)instance variable
(b)local variable
(c)global variable
(d)the class name as a calling object
(a)instance variable
(b)local variable
(c)global variable
(d)the class name as a calling object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
18
Converting from a value of primitive type to a corresponding object of its associated wrapper class is called:
(a)Boxing
(b)Unboxing
(c)Converting
(d)Reinstantiating
(a)Boxing
(b)Unboxing
(c)Converting
(d)Reinstantiating
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
19
All of the following are wrapper classes except:
(a)String
(b)Integer
(c)Character
(d)Double
(a)String
(b)Integer
(c)Character
(d)Double
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
20
Only ______ copy/copies of a static variable are available to objects of a class.
(a)one
(b)two
(c)three
(d)none of the above
(a)one
(b)two
(c)three
(d)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
21
Write a Java method that returns true if and only if a character is a digit or a letter.The method should display appropriate feedback to the console.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
22
Primitive types are reference types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
23
Write ONE Java statement that computes and displays a random number between 1 and 25.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
24
Write a statement that creates and initializes a static variable named salesTax to 7.59.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
25
Deprecated methods should be used in new Java code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
26
You should avoid the use of null as an argument to a method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
27
Write a statement that creates a constant variable named TAX_RATE.The tax rate is 8.25%.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
28
A class invariant is a statement that is always true for every object of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
29
How many bytes are contained within 16-bits,32-bits,64-bits?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
30
Wrapper classes provide a class type corresponding to each of the primitive types so that you can have class types that behave somewhat like primitive types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
31
Explain in detail how main memory works.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
32
You may use methods of the Math class without an import statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
33
Wrapper classes are provided for all primitive Java types except Boolean.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
34
To use a package,the program must contain an import statement that names the package.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
35
A bit may have the value of either a 1 or 0.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
36
Write ONE Java statement that computes and displays the value of 25.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
37
When used with objects,what is the equality ( == )operator really comparing?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
38
The String class is a mutable class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
39
Define boxing and unboxing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
40
All versions of Java support automatic boxing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
41
Does an object created with a copy constructor reference the same memory location that the original object references? Explain.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
42
Add accessor and mutator methods to the Book class created in question #13.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
43
Explain how a package is named in Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
44
Create a Java class named Book with instance variables title,author,ISBN,and yearPublished.Include javadoc style comments to describe your interface.Such a class would normally have methods,but you are not required to supply any methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
45
Add a constructor and a copy constructor to the Book class created in question #13.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
46
What is the purpose of Java's wrapper classes?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck