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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post 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 26 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页
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply