Question: JAVA 1.can be an object be referenced by a variable of several different data types? 2- Describe two uses for the keyword uses? 3. What

JAVA

1.can be an object be referenced by a variable of several different data types?

2- Describe two uses for the keyword uses?

3. What is the difference between this and super when these words are used within a constructor definition as the names of methods that are called?

4. Consider the code below, which was discussed in the previous section:

Student joe = new Student("Joe Student", 2001);

System.out.println(joe.toString());

Why is the output on two lines instead of being all on one line?

5. Which of the following lines are legal and which are illegal? The class Undergraduate is a derived class of Student, and Student is a derived class of Person

.a.Person p1 =new Student();

b.Person p2 =new Undergraduate();

c.Student s1 =new Person();

d.Student s2 =new Undergraduate();

e.Undergraduate ug1 =new Person();

f.Undergraduate ug2 =new Student();

g.Object ob =new Student();

h.Student s3 =new Object();

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!