Page 1 of 1

2. Read the following program code carefully, and complete the statements underlined (1) to (5) abstract class Person pr

Posted: Tue Jun 07, 2022 12:41 pm
by answerhappygod
2 Read The Following Program Code Carefully And Complete The Statements Underlined 1 To 5 Abstract Class Person Pr 1
2 Read The Following Program Code Carefully And Complete The Statements Underlined 1 To 5 Abstract Class Person Pr 1 (30.82 KiB) Viewed 27 times
2. Read the following program code carefully, and complete the statements underlined (1) to (5) abstract class Person private String name; public Person (String n) { name = n: } public (1) String getMajor (): _00 public String (2) return name: } } class Student (3) Person private (4) public Student (String n, String m) { super (n): major = m; } public String (5) return "major is :" + major: _01 public class TestPerson ( public static void main(String args[]) { Person p = new Student ("tom", "Al engineering"); System.out.println (p. getName()+", "+p. getMajor()); 第5页