Pre-Quiz Arrays and Strings - Attempt Review
Pre-Quiz Arrays and Strings - Attempt Review
Dashboard / My courses / Java / Arrays and Strings / Pre-Quiz Arrays and Strings
Quiz review
Started on Monday, 11 March 2024, 12:16 AM
State Finished
Completed on Monday, 11 March 2024, 12:19 AM
Time taken 3 mins 1 sec
Marks 5.00/8.00
Grade 62.50 out of 100.00
Feedback Oops!!! You have scored below 80%. So kindly make necessary preparation and reattempt.
Question 1
Incorrect
47353
Select one:
a. Constructor of a class should not have a return type, which means the return type is void
b.
Constructor will be invoked explicitly like other methods
d.
Constructor should have same name as class name, but not case sensitive
47353
Your answer is incorrect.
The correct answer is:
Constructor can be overloaded
Question 2
Correct
Select one:
a. 10
c. Runtime Exception
d. 0
https://accenturelearning.tekstac.com/mod/quiz/review.php?attempt=1422218&cmid=5214 1/6
3/11/24, 12:19 AM Pre-Quiz Arrays and Strings: Attempt review
Question 3
Correct
Which members of a class can be accessed by other classes is determined by the ________________
Select one:
a. class
b. variables
c. constructor
d. Access specifier
47353
Question 4
Incorrect
https://accenturelearning.tekstac.com/mod/quiz/review.php?attempt=1422218&cmid=5214 2/6
3/11/24, 12:19 AM Pre-Quiz Arrays and Strings: Attempt review
Question 5
Correct
Select one:
a.
1 and 2
b. 1, 2 and 3
c.
2 and 3
47353
d. 1, 2 and 4
47353
47353
https://accenturelearning.tekstac.com/mod/quiz/review.php?attempt=1422218&cmid=5214 3/6
3/11/24, 12:19 AM Pre-Quiz Arrays and Strings: Attempt review
Question 6
Incorrect
package edu.ABC.model;
public class Account {
public static final float INTERTEST_RATE = 7.5;
}
c.
import edu.ABC.model.Account ;
public class Loan {
public double getInterest() { 47353
return Account.INTEREST_RATE;
}
}
d.
import static edu.ABC.model.Account.*;
public class Loan {
public double getInterest() {
return INTEREST_RATE;
}
}
47353
Your answer is incorrect.
The correct answers are:
import static edu.ABC.model.Account.*;
public class Loan {
public double getInterest() {
return INTEREST_RATE;
}
}, import edu.ABC.model.Account ;
public class Loan {
public double getInterest() {
return Account.INTEREST_RATE;
}
}
https://accenturelearning.tekstac.com/mod/quiz/review.php?attempt=1422218&cmid=5214 4/6
3/11/24, 12:19 AM Pre-Quiz Arrays and Strings: Attempt review
Question 7
Correct
Given:
public class ItemTest
{
private final int id;
public ItemTest(int id) {
this.id = id;
}
public void updateId(int newId) {
id = newId;
}
public static void main(String[] args) {
ItemTest fa = new ItemTest(42);
fa.updateId(69);
System.out.println(fa.id);
}
} 47353
What is the result?
Select one:
a. CompileTime Error
b.
69
c.
Runtime Error
Question 8
Correct
Select one:
a. Used for calling the parameterized constructor of the parent class.
47353
c.
Used for calling the no argument constructor of the same class.
Jump to...
https://accenturelearning.tekstac.com/mod/quiz/review.php?attempt=1422218&cmid=5214 5/6
3/11/24, 12:19 AM Pre-Quiz Arrays and Strings: Attempt review
47353
47353
47353
https://accenturelearning.tekstac.com/mod/quiz/review.php?attempt=1422218&cmid=5214 6/6