ADE
Since the class Toy is a an abstract class, it is not instantiated. B is false.
If a method doesn't have a body, it has an abstract keyword in its method signature. It is mandatory. C is false.
ADE.
abstract class Toy {
int price;
public static void insertToy() {
// code
}
public int calculatePrice() {
return price;
}
public abstract int computeDiscount();
}
The correct answer is ADE:
A -> Correct, a method for inserting the toy with the relevant assignments made.
B -> Wrong, when placing final, it can only have one name, in case of value exchange it will give an error.
C -> Wrong, printing a worthless toy will not have logic in the code.
D -> Correct, you can calculate the price by returning the price.
E -> Correct, you can compute a discount with the parameters.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
MPignaProTech
2 months, 4 weeks agoTOPPSI
2 years agoakbiyik
2 years, 1 month agoUAK94
2 years, 3 months agoiSnover
2 years, 3 months ago