Deck 5: Defining Classes II
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/46
العب
ملء الشاشة (f)
Deck 5: Defining Classes II
1
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
A
2
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
D
3
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
B
4
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
5
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
6
A copy constructor has _________ parameters.
A)zero
B)one
C)two
D)three
A)zero
B)one
C)two
D)three
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
7
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
8
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
9
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
10
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
11
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
12
A main method can be placed inside a class definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
13
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
14
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
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
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
17
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
18
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
19
In a static method,you may use the this parameter either explicitly or implicitly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
20
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
21
All versions of Java support automatic boxing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
22
Write a statement that creates and initializes a static variable named salesTax to 7.59.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
23
Wrapper classes are provided for all primitive Java types except Boolean.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
24
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
25
The String class is a mutable class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
26
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
27
Define boxing and unboxing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
28
To use a package,the program must contain an import statement that names the package.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
29
You may use methods of the Math class without an import statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
30
Write ONE Java statement that computes and displays a random number between 1 and 25.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
31
A bit may have the value of either a 1 or 0.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
32
Deprecated methods should be used in new Java code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
33
You should avoid the use of null as an argument to a method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
34
When used with objects,what is the equality == )operator really comparing?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
35
A class invariant is a statement that is always true for every object of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
36
How many bytes are contained within 16-bits,32-bits,64-bits?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
37
Write ONE Java statement that computes and displays the value of 2< sup >5< /sup >.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
38
Explain in detail how main memory works.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
39
Write a statement that creates a constant variable named TAX_RATE.The tax rate is 8.25%.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
40
Primitive types are reference types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 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 a constructor and a copy constructor to the Book class created in question #13.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
43
Add accessor and mutator methods to the Book class created in question #13.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
44
Explain how a package is named in Java.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
45
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
46
What is the purpose of Java's wrapper classes?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck