Question: number 11 please explain it An interface is designed to represent an athlete. An athlete has a name and a sport. The class heading is

number 11 please explain it An interface is designed to represent annumber 11 please explain it

An interface is designed to represent an athlete. An athlete has a name and a sport. The class heading is as follows. public interface Athlete Which of the following will result in a compiler error if included in the interface. private String myname; private String mySport; public Athlete (string name, string sport)} myName = name; mySport = sport; public string getName (); public string getsport e (); a. I and II only b. I, II, III c. III only d. Only e. II only Which of the following pairs is not inheritance (is-a) relationship? a. Student, Person b. Car, Vehicle c. Car, Tire d. Sedan, Car e. Violin, Instrument Which of the following expressions tests whether the object cat belongs to the type Animal? a. (cat belongsTo Animal) b. (cat instanceof Animal) c. cat implements Animal d. (Animal contains cat) e. (Animal instanceof cat) Suppose an Employee class contains a method setName to set the value of an Employee object's instance variable name, plus a method getName to access the value of name. Consider the following code fragment: Employee e1 e2; e1 = new Employee (); e2 = new Employee (); e1. setName ("Sally"); e2. setName ("Jane"); e2 = e1; e2. setName ("Martha"); System. Out. printIn (e1. getName ()); What would be displayed on the console? a. Sally b. Jane c. Martha d. null

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!