Question: Suppose that the main method in code below was part of the IntCell class. a. Would the program still work? b. Could the commented-out line

Suppose that the main method in code below was part of the IntCell class. a. Would the program still work? b. Could the commented-out line in main be uncommented without generating an error? class Person \{ public static final int NOSSN=1 private int SSN=0; String name = null; \} class TestPerson \{ private Person p= new Person( ) public static void main( String [] args ) \{ Person q= new Person ( ) ; System.out.println( p ); // illegal System.out.println( q ); // legal System.out.println( q.NO_SSN ); // ? System.out.println( q.SSN ); // ? System.out.println( q.name ); // ? System.out.println(Person.NO_SSN ); // ? System.out.println( Person.SSN );// ? \} \} Is the following import directive, which attempts to import virtually the entire Java library, legal? import java.*."; What members of an inherited class can be used in the derived class? What members become public for users of the derived class? What is composition
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
