Can You please help me with this JAVA question? d on the following quizzes quest
ID: 3875265 • Letter: C
Question
Can You please help me with this JAVA question? d on the following quizzes questions. Athlete IS ABSTRACT! Soccer extends Athlete. public abstract class Athlete ( String name; public abstract void typeO) public void cheer)f System.out.println("YAY!!"); I/ end method cheer ) /I end class Athlete public class Soccer extends Athlete( int goals public Soccer(int goals)K this.goals goals; @Override public void typeO( System.out.printin("Soccer") Y// end method type /lend class Soccer Given the following code, what is printed? Athlete a1 new Athlete(): a1.type) O Athlete O Soccer O Runtime Error O Compiler ErrorExplanation / Answer
Q2
Here the athlete is an abstract class and we know that we cannot instantiate an abstract class so it will result in compiler error.
Q3
The option 1 is correct and it correctly defined data encapsulation.
Q4
The option 1 is correct as member variables are available to all methods in an object of a class
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.