Deck 6: A First Look at Classes

ملء الشاشة (f)
exit full mode
سؤال
Methods that operate on an object's fields are called __________.

A) instance methods
B) instance variables
C) private methods
D) public methods
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A method that gets a value from a class's field but does not change it is known as a mutator method.
سؤال
The term "no-arg constructor" is applied to any constructor that does not accept arguments.
سؤال
The java.lang package is automatically imported into all Java programs.
سؤال
When a local variable in an instance method has the same name as an instance field, the instance field hides the local variable.
سؤال
When an object is passed as an argument to a method, the object's address is passed into the method's parameter variable.
سؤال
A class's responsibilities include __________.

A) the things a class is responsible for knowing
B) the things a class is responsible for doing
C) both of these
D) neither of these
سؤال
Instance methods do not have the key word static in their headers.
سؤال
Data hiding (which means that critical data stored inside the object is protected from code outside the object) is accomplished in Java by __________.

A) using the public access specifier on the class methods
B) using the private access specifier on the class methods
C) using the private access specifier on the class fields
D) using the private access specifier on the class definition
سؤال
An object can store data.
سؤال
A group of related classes is called a(n) __________.

A) archive
B) package
C) collection
D) attachment
سؤال
A class is not an object. It is a description of an object.
سؤال
A constructor is a method that is automatically called when an object is created.
سؤال
The term "default constructor" is applied to the first constructor written by the author of the class.
سؤال
When an object is created, the attributes associated with the object are called __________.

A) instance fields
B) class instances
C) instance methods
D) fixed attributes
سؤال
Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.
سؤال
The public access specifier for a field indicates that the field may not be accessed by statements outside the class.
سؤال
A method that stores a value in a class's field or in some other way changes the value of a field is known as a mutator method.
سؤال
An access specifier indicates how a class may be accessed.
سؤال
Instance methods should be declared static.
سؤال
The following statement is an example of __________.
import java.util.*;

A) an explicit import statement
B) an unconditional import statement
C) a wildcard import statement
D) a conditional import statement
سؤال
The scope of a private instance field is __________.

A) the instance methods of the same class
B) inside the class but not inside any method in that class
C) inside the parentheses of a method header
D) the method in which it is defined
سؤال
For the following code, which statement is not true?
public class Sphere
{
Private double radius;
Public double x;
Private double y;
Private double z;
}

A) The z field is available to code written outside the Sphere class.
B) The radius field is not available to code written outside the Sphere class.
C) The radius, x, y, and z fields are members of the Sphere class.
D) The x field is available to code that is written outside the Sphere class.
سؤال
Class objects normally have __________ that perform useful operations on their data, but primitive variables do not.

A) fields
B) relationships
C) methods
D) instances
سؤال
After the header, the body of the method appears inside a set of __________.

A) braces, { }
B) parentheses, ( )
C) brackets, [ ]
D) double quotes, " "
سؤال
Which symbol indicates that a member is private a UML diagram?

A) -
B) *
C) #
D) +
سؤال
A constructor __________.

A) always accepts two arguments
B) has the same name as the class
C) has the return type of void
D) always has a private access specifier
سؤال
The following statement is an example of __________.
import java.util.Scanner;

A) an explicit import statement
B) an unconditional import statement
C) a wildcard import statement
D) a conditional import statement
سؤال
__________ refers to combining data and code into a single object.

A) Data hiding
B) Abstraction
C) The constructor
D) Encapsulation
سؤال
To indicate the data type of a variable in a UML diagram, you enter __________.

A) the variable name followed by the data type
B) the variable name followed by a colon and the data type
C) the class name followed by the variable name followed by the data type
D) the data type followed by the variable name
سؤال
Which of the following is not involved in identifying the classes to be used when developing an object-oriented application?

A) a description of the problem domain
B) the code
C) a refined list of nouns that include only those relevant to the problem
D) all the nouns are identified
سؤال
For the following code, which statement is not true?
public class Circle
{
Private double radius;
Public double x;
Private double y;
}

A) The y field is available to code written outside the Circle class.
B) The radius field is not available to code written outside the Circle class.
C) The radius, x, and y fields are members of the Circle class.
D) The x field is available to code that is written outside the Circle class.
سؤال
What does the following UML diagram entry mean? + setHeight(h : double) : void

A) a public method with a parameter of data type double that does not return a value
B) a private field called setHeight that is a double data type
C) a private method with no parameters that returns a double data type
D) a public field called setHeight that is a double data type
سؤال
It is common practice in object-oriented programming to make all of a class's __________.

A) fields private
B) methods private
C) fields public
D) fields and methods public
سؤال
You should not define a class that is dependent on the values of other class fields __________.

A) in order to keep it current
B) because it is redundant
C) in order to avoid having stale data
D) because it should be defined in another class
سؤال
Which symbol indicates that a member is public in a UML diagram?

A) -
B) *
C) #
D) +
سؤال
A constructor is a method that __________.

A) returns an object of the class
B) never receives any arguments
C) performs initialization or setup operations
D) removes the object from memory
سؤال
One or more objects may be created from a(n) __________.

A) field
B) method
C) instance
D) class
سؤال
A class specifies the __________ and __________ that a particular type of object has.

A) relationships, methods
B) fields, object names
C) fields, methods
D) relationships, object names
سؤال
Another term for an object of a class is a(n) __________.

A) access specifier
B) instance
C) member
D) method
سؤال
When an object is passed as an argument to a method, what is passed into the method's parameter variable?

A) the class name
B) the object's memory address
C) the values for each field
D) the method names
سؤال
When you work with a __________, you are using a storage location that holds a piece of data.

A) primitive variable
B) reference variable
C) numeric literal
D) binary number
سؤال
Select all that apply. Which of the following are classes from the Java API?

A) Scanner
B) Random
C) Package
D) PrintWriter
سؤال
Most of the programming languages used today are __________.

A) procedural
B) top-down
C) object-oriented
D) functional
سؤال
Overloading means that multiple methods in the same class __________.

A) have the same name but different return types
B) have different names but the same parameter list
C) have the same name but different parameter lists
D) perform the same function
سؤال
The __________ package is automatically imported into all Java programs.

A) java.java
B) java.default
C) java.util
D) java.lang
سؤال
A UML diagram does not contain __________.

A) the class name
B) the method names
C) the field names
D) the object names
سؤال
A constructor __________.

A) always accepts two arguments
B) has the return type of void
C) has the same name as the class
D) always has a private access specifier
سؤال
A(n) __________ can be thought of as a blueprint that can be used to create a type of __________.

A) object, class
B) class, object
C) cookie, cake
D) object, method
سؤال
The scope of a public instance field is __________.

A) only the class in which it is defined
B) inside the class but not inside any method
C) inside the parentheses of a method header
D) the instance methods and methods outside the class
سؤال
Instance methods do not have the __________ key word in their headers.

A) public
B) static
C) private
D) protected
سؤال
Java allows you to create objects of the __________ class in the same way you would create primitive variables.

A) Random
B) String
C) PrintWriter
D) Scanner
سؤال
A reference variable stores a(n) __________.

A) binary encoded decimal
B) memory address
C) object
D) string
سؤال
Which of the following statements will create a reference, str, to the String "Hello, World"?

A) String str = "Hello, World";
B) string str = "Hello, World";
C) String str = new "Hello, World";
D) str = "Hello, World";
سؤال
Given the following code, what will be the value of finalAmount when it is displayed?
public class Order
{
Private int orderNum;
Private double orderAmount;
Private double orderDiscount;
Public Order(int orderNumber, double orderAmt,
Double orderDisc)
{
OrderNum = orderNumber;
OrderAmount = orderAmt;
OrderDiscount = orderDisc;
}
Public int getOrderAmount()
{
Return orderAmount;
}
Public int getOrderDisc()
{
Return orderDisc;
}
}
Public class CustomerOrder
{
Public static void main(String[] args)
{
Int ordNum = 1234;
Double ordAmount = 580.00;
Double discountPer = .1;
Order order;
Double finalAmount = order.getOrderAmount() -
Order.getOrderAmount() * order.getOrderDisc();
System.out.printf("Final order amount = $%,.2f\n",
FinalAmount);
}
}

A) 528.00
B) 580.00
C) There is no value because the constructor has an error.
D) There is no value because the object, order, has not been created.
سؤال
Given the following code, what will be the value of finalAmount when it is displayed?
public class Order
{
Private int orderNum;
Private double orderAmount;
Private double orderDiscount;
Public Order(int orderNumber, double orderAmt,
Double orderDisc)
{
OrderNum = orderNumber;
OrderAmount = orderAmt;
OrderDiscount = orderDisc;
}
Public double finalOrderTotal()
{
Return orderAmount - orderAmount * orderDiscount;
}
}
Public class CustomerOrder
{
Public static void main(String[ ] args)
{
Order order;
Int orderNumber = 1234;
Double orderAmt = 580.00;
Double orderDisc = .1;
Order = new Order(orderNumber, orderAmt, orderDisc);
Double finalAmount = order.finalOrderTotal();
System.out.printf("Final order amount = $%,.2f\n",
FinalAmount);
}
}

A) 528.00
B) 580.00
C) 522.00
D) There is no value because the object, order, has not been created.
سؤال
Two or more methods in a class may have the same name as long as __________.

A) they have different return types
B) they have different parameter lists
C) they have different return types but the same parameter list
D) You cannot have two methods with the same name.
سؤال
Methods that operate on an object's fields are called __________.

A) instance variables
B) instance methods
C) public methods
D) private methods
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/58
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 6: A First Look at Classes
1
Methods that operate on an object's fields are called __________.

A) instance methods
B) instance variables
C) private methods
D) public methods
A
2
A method that gets a value from a class's field but does not change it is known as a mutator method.
False
3
The term "no-arg constructor" is applied to any constructor that does not accept arguments.
True
4
The java.lang package is automatically imported into all Java programs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
5
When a local variable in an instance method has the same name as an instance field, the instance field hides the local variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
6
When an object is passed as an argument to a method, the object's address is passed into the method's parameter variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
7
A class's responsibilities include __________.

A) the things a class is responsible for knowing
B) the things a class is responsible for doing
C) both of these
D) neither of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
8
Instance methods do not have the key word static in their headers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
9
Data hiding (which means that critical data stored inside the object is protected from code outside the object) is accomplished in Java by __________.

A) using the public access specifier on the class methods
B) using the private access specifier on the class methods
C) using the private access specifier on the class fields
D) using the private access specifier on the class definition
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
10
An object can store data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
11
A group of related classes is called a(n) __________.

A) archive
B) package
C) collection
D) attachment
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
12
A class is not an object. It is a description of an object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
13
A constructor is a method that is automatically called when an object is created.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
14
The term "default constructor" is applied to the first constructor written by the author of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
15
When an object is created, the attributes associated with the object are called __________.

A) instance fields
B) class instances
C) instance methods
D) fixed attributes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
16
Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
17
The public access specifier for a field indicates that the field may not be accessed by statements outside the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
18
A method that stores a value in a class's field or in some other way changes the value of a field is known as a mutator method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
19
An access specifier indicates how a class may be accessed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
20
Instance methods should be declared static.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
21
The following statement is an example of __________.
import java.util.*;

A) an explicit import statement
B) an unconditional import statement
C) a wildcard import statement
D) a conditional import statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
22
The scope of a private instance field is __________.

A) the instance methods of the same class
B) inside the class but not inside any method in that class
C) inside the parentheses of a method header
D) the method in which it is defined
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
23
For the following code, which statement is not true?
public class Sphere
{
Private double radius;
Public double x;
Private double y;
Private double z;
}

A) The z field is available to code written outside the Sphere class.
B) The radius field is not available to code written outside the Sphere class.
C) The radius, x, y, and z fields are members of the Sphere class.
D) The x field is available to code that is written outside the Sphere class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
24
Class objects normally have __________ that perform useful operations on their data, but primitive variables do not.

A) fields
B) relationships
C) methods
D) instances
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
25
After the header, the body of the method appears inside a set of __________.

A) braces, { }
B) parentheses, ( )
C) brackets, [ ]
D) double quotes, " "
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which symbol indicates that a member is private a UML diagram?

A) -
B) *
C) #
D) +
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
27
A constructor __________.

A) always accepts two arguments
B) has the same name as the class
C) has the return type of void
D) always has a private access specifier
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
28
The following statement is an example of __________.
import java.util.Scanner;

A) an explicit import statement
B) an unconditional import statement
C) a wildcard import statement
D) a conditional import statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
29
__________ refers to combining data and code into a single object.

A) Data hiding
B) Abstraction
C) The constructor
D) Encapsulation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
30
To indicate the data type of a variable in a UML diagram, you enter __________.

A) the variable name followed by the data type
B) the variable name followed by a colon and the data type
C) the class name followed by the variable name followed by the data type
D) the data type followed by the variable name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
31
Which of the following is not involved in identifying the classes to be used when developing an object-oriented application?

A) a description of the problem domain
B) the code
C) a refined list of nouns that include only those relevant to the problem
D) all the nouns are identified
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
32
For the following code, which statement is not true?
public class Circle
{
Private double radius;
Public double x;
Private double y;
}

A) The y field is available to code written outside the Circle class.
B) The radius field is not available to code written outside the Circle class.
C) The radius, x, and y fields are members of the Circle class.
D) The x field is available to code that is written outside the Circle class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
33
What does the following UML diagram entry mean? + setHeight(h : double) : void

A) a public method with a parameter of data type double that does not return a value
B) a private field called setHeight that is a double data type
C) a private method with no parameters that returns a double data type
D) a public field called setHeight that is a double data type
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
34
It is common practice in object-oriented programming to make all of a class's __________.

A) fields private
B) methods private
C) fields public
D) fields and methods public
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
35
You should not define a class that is dependent on the values of other class fields __________.

A) in order to keep it current
B) because it is redundant
C) in order to avoid having stale data
D) because it should be defined in another class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
36
Which symbol indicates that a member is public in a UML diagram?

A) -
B) *
C) #
D) +
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
37
A constructor is a method that __________.

A) returns an object of the class
B) never receives any arguments
C) performs initialization or setup operations
D) removes the object from memory
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
38
One or more objects may be created from a(n) __________.

A) field
B) method
C) instance
D) class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
39
A class specifies the __________ and __________ that a particular type of object has.

A) relationships, methods
B) fields, object names
C) fields, methods
D) relationships, object names
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
40
Another term for an object of a class is a(n) __________.

A) access specifier
B) instance
C) member
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
41
When an object is passed as an argument to a method, what is passed into the method's parameter variable?

A) the class name
B) the object's memory address
C) the values for each field
D) the method names
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
42
When you work with a __________, you are using a storage location that holds a piece of data.

A) primitive variable
B) reference variable
C) numeric literal
D) binary number
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
43
Select all that apply. Which of the following are classes from the Java API?

A) Scanner
B) Random
C) Package
D) PrintWriter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
44
Most of the programming languages used today are __________.

A) procedural
B) top-down
C) object-oriented
D) functional
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
45
Overloading means that multiple methods in the same class __________.

A) have the same name but different return types
B) have different names but the same parameter list
C) have the same name but different parameter lists
D) perform the same function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
46
The __________ package is automatically imported into all Java programs.

A) java.java
B) java.default
C) java.util
D) java.lang
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
47
A UML diagram does not contain __________.

A) the class name
B) the method names
C) the field names
D) the object names
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
48
A constructor __________.

A) always accepts two arguments
B) has the return type of void
C) has the same name as the class
D) always has a private access specifier
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
49
A(n) __________ can be thought of as a blueprint that can be used to create a type of __________.

A) object, class
B) class, object
C) cookie, cake
D) object, method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
50
The scope of a public instance field is __________.

A) only the class in which it is defined
B) inside the class but not inside any method
C) inside the parentheses of a method header
D) the instance methods and methods outside the class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
51
Instance methods do not have the __________ key word in their headers.

A) public
B) static
C) private
D) protected
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
52
Java allows you to create objects of the __________ class in the same way you would create primitive variables.

A) Random
B) String
C) PrintWriter
D) Scanner
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
53
A reference variable stores a(n) __________.

A) binary encoded decimal
B) memory address
C) object
D) string
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which of the following statements will create a reference, str, to the String "Hello, World"?

A) String str = "Hello, World";
B) string str = "Hello, World";
C) String str = new "Hello, World";
D) str = "Hello, World";
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
55
Given the following code, what will be the value of finalAmount when it is displayed?
public class Order
{
Private int orderNum;
Private double orderAmount;
Private double orderDiscount;
Public Order(int orderNumber, double orderAmt,
Double orderDisc)
{
OrderNum = orderNumber;
OrderAmount = orderAmt;
OrderDiscount = orderDisc;
}
Public int getOrderAmount()
{
Return orderAmount;
}
Public int getOrderDisc()
{
Return orderDisc;
}
}
Public class CustomerOrder
{
Public static void main(String[] args)
{
Int ordNum = 1234;
Double ordAmount = 580.00;
Double discountPer = .1;
Order order;
Double finalAmount = order.getOrderAmount() -
Order.getOrderAmount() * order.getOrderDisc();
System.out.printf("Final order amount = $%,.2f\n",
FinalAmount);
}
}

A) 528.00
B) 580.00
C) There is no value because the constructor has an error.
D) There is no value because the object, order, has not been created.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
56
Given the following code, what will be the value of finalAmount when it is displayed?
public class Order
{
Private int orderNum;
Private double orderAmount;
Private double orderDiscount;
Public Order(int orderNumber, double orderAmt,
Double orderDisc)
{
OrderNum = orderNumber;
OrderAmount = orderAmt;
OrderDiscount = orderDisc;
}
Public double finalOrderTotal()
{
Return orderAmount - orderAmount * orderDiscount;
}
}
Public class CustomerOrder
{
Public static void main(String[ ] args)
{
Order order;
Int orderNumber = 1234;
Double orderAmt = 580.00;
Double orderDisc = .1;
Order = new Order(orderNumber, orderAmt, orderDisc);
Double finalAmount = order.finalOrderTotal();
System.out.printf("Final order amount = $%,.2f\n",
FinalAmount);
}
}

A) 528.00
B) 580.00
C) 522.00
D) There is no value because the object, order, has not been created.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
57
Two or more methods in a class may have the same name as long as __________.

A) they have different return types
B) they have different parameter lists
C) they have different return types but the same parameter list
D) You cannot have two methods with the same name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
58
Methods that operate on an object's fields are called __________.

A) instance variables
B) instance methods
C) public methods
D) private methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 58 في هذه المجموعة.