1. What will be the result of this code? Assume that setName and getName work pr
ID: 3731427 • Letter: 1
Question
1. What will be the result of this code?
Assume that setName and getName work properly.
2. Assuming the following code:
If every person in a given array of people were the same age, then the first person in the array would be both the youngest and oldest person in the array.
A. True
B. False
3. Which of the following methods is most likely an example of method overriding?
A. setAge
B. toString
C. encryptInformation
D. setName
4. In passing an array to a method, the value of the argument is copied to the parameter.
A. True
B. False
A. Ali BabaExplanation / Answer
1)
ans:- A. Ali Baba
2)
If every person in a given array of people were the same age, then the first person in the array would be
both the youngest and oldest person in the array.
Ans:- True.
since there is no coondition
therefore for loop is ignored.
since minIdx and maxIdx is assigned to 0. minIdx = 0; maxIdx=0;
Therefore first person in the array would both the youngest and oldest person in the array.
3)
Ans:
A. setAge
B. toString
D. setName
4)
In passing an array to a method, the value of the argument is copied to the parameter.
TRUE.
It is making a copy in memory of the actual parameter's value that is passed in.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.