- 2 Read The Following Program Code Carefully And Complete The Statements Underlined 1 To 5 Abstract Class Person Pr 1 (30.82 KiB) Viewed 26 times
2. Read the following program code carefully, and complete the statements underlined (1) to (5) abstract class Person pr
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
2. Read the following program code carefully, and complete the statements underlined (1) to (5) abstract class Person pr
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页