Pete
09-11-2002, 12:38 AM
I need to make sure that I am interpreting
statements properly. Please tell me if I
am understanding this properly:
System.out.println(
"Enter yearly interest rate ");
annualInterestRate = MyInput.readDouble();
/*
'System' is the class which the 'out' object
variable belongs to. Including it in this
statement makes the 'out' object available.
Would 'System' be considered an object in
this context?
'out' is an object that belongs to the class
'System.' Correct?
println(...) is a method that belongs that
belongs to the class 'System.' The argument
is passed to the predefined methods in
println(...), which output the argument to
the screen with a line break after it.
Correct?
MyInput is a class that contains the methods
for reading int, double and string values from
the keyboard. I assume, in this case, it's
considered an object, which can access
readDouble() because readDouble() is encapsulated
within the class Myinput. readDouble() gets
the data of type double and then initializes
the object MyInput with that data. Then that
data value is given to the variable
annualInterestRate, i.e. initialzies
annualInterestRate to that value.
Correct?
*/
If I'm incomplete/inaccurate, please advise!
Thanks in advance!
Pete
statements properly. Please tell me if I
am understanding this properly:
System.out.println(
"Enter yearly interest rate ");
annualInterestRate = MyInput.readDouble();
/*
'System' is the class which the 'out' object
variable belongs to. Including it in this
statement makes the 'out' object available.
Would 'System' be considered an object in
this context?
'out' is an object that belongs to the class
'System.' Correct?
println(...) is a method that belongs that
belongs to the class 'System.' The argument
is passed to the predefined methods in
println(...), which output the argument to
the screen with a line break after it.
Correct?
MyInput is a class that contains the methods
for reading int, double and string values from
the keyboard. I assume, in this case, it's
considered an object, which can access
readDouble() because readDouble() is encapsulated
within the class Myinput. readDouble() gets
the data of type double and then initializes
the object MyInput with that data. Then that
data value is given to the variable
annualInterestRate, i.e. initialzies
annualInterestRate to that value.
Correct?
*/
If I'm incomplete/inaccurate, please advise!
Thanks in advance!
Pete