Questions and Answers
What is the purpose of the Bicycle constructor?
To initialize the data members with default values
How many source files are used in the given example?
Two
What is the data type of the tagNo data member?
String
What is the initial value assigned to the ownerName data member?
Signup and view all the answers
What is the purpose of adding a new method to the Bicycle class?
Signup and view all the answers
In which file is the Bicycle class definition stored?
Signup and view all the answers
What is the purpose of the setTagNo method in the Bicycle class?
Signup and view all the answers
What is the default owner name when an Account object is created?
Signup and view all the answers
What is the purpose of the add method in the Account class?
Signup and view all the answers
What does the getOwnerName method return in the Account class?
Signup and view all the answers
What is the purpose of the setInitialBalance method in the Account class?
Signup and view all the answers
What is the purpose of the deduct method in the Account class?
Signup and view all the answers
What is the name of the class that uses both the Bicycle and Account classes?
Signup and view all the answers
What is the initial balance set to in the Account class?
Signup and view all the answers
What is the output of the code fragment acct.add(25.00); acct.deduct(50);?
Signup and view all the answers
What is the name of the method that adds an amount to the current balance?
Signup and view all the answers
What is the purpose of the setOwnerName method?
Signup and view all the answers
What is the purpose of a parameter in a method?
Signup and view all the answers
What is the requirement for matching arguments and parameters?
Signup and view all the answers
What happens when an argument is passed to a method?
Signup and view all the answers
What is the restriction on the assignment of arguments to parameters?
Signup and view all the answers
What is the memory allocation process for the receiving method?
Signup and view all the answers
What happens to the literal constant in the example demo.compute(i, k, 20)?
Signup and view all the answers
What happens when a class component is declared private?
Signup and view all the answers
Why should data members be declared private?
Signup and view all the answers
What is information hiding?
Signup and view all the answers
When can constants be declared public?
Signup and view all the answers
What is the effect of declaring a method private?
Signup and view all the answers
What is the purpose of declaring class components as public or private?
Signup and view all the answers