Object Oriented programming JAVA Take the person class you created for today (below announcement from July 6) Wr

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

Object Oriented programming JAVA Take the person class you created for today (below announcement from July 6) Wr

Post by answerhappygod »

Object Oriented programming JAVATake the person class you created for today (below announcement from July 6) Write a class named Person that has data members name and age. Include a public method named sayHello() that prints on the screen “Hello! I am “, followed by the name and age of the person. Create a program PersonDemo to test the class Person. class variables can be public here.1) (Encapsulation) Show this inital version of your program being tested. (only screenshots required of code and testing)2) (Information hiding) Modify this person class to make the class variables private and add getters/setters. 3) Add another member method displayInfo(), which displays the information about the person (name and age).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply