Question: why doesn't code in 2.9 work like in 2.8? 2.8 Does this code compile? If it does, what is its output? class A 1 public

 why doesn't code in 2.9 work like in 2.8? 2.8 Does

why doesn't code in 2.9 work like in 2.8?

2.8 Does this code compile? If it does, what is its output? class A 1 public class B extends At public static void main(Stringl] args) f Aa=new B(); System.out.println ("works"); works 2.9 Does this code compile? If it does, what is its output? class A th public class B extends Af public static void main(String [] args) B a = new A(); System. out . println("works"); compile error: B.java :5: error: incompatible types: A cannot be converted to B B a = new A(); 1 error

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!