├── README.md └── Mock-test-2-java-PPT-PW-skills-Question Public └── Mock_test_2_java_PPT_PW_skills_First_Question_Public.java /README.md: -------------------------------------------------------------------------------- 1 | # Mock-test-2-java-PPT-PW-skills-First-Question 2 | 3 | 👋 Welcome to my Java project! 4 | 5 | ## Overview 6 | This project contains a `Person` class that has fields for name, age, and address. It also contains a `Main` class that demonstrates how to use the `Person` class. 7 | 8 | ## Usage 9 | To use this project, simply clone the repository and run the `Main` class. 10 | 11 | ## Example Output 12 | - Name: John 13 | - Age: 30 14 | - Address: 123 Main St 15 | -------------------------------------------------------------------------------- /Mock-test-2-java-PPT-PW-skills-Question Public/Mock_test_2_java_PPT_PW_skills_First_Question_Public.java: -------------------------------------------------------------------------------- 1 | public class Person { 2 | private String name; 3 | private int age; 4 | private String address; 5 | 6 | public String getName() { 7 | return name; 8 | } 9 | 10 | public void setName(String name) { 11 | this.name = name; 12 | } 13 | 14 | public int getAge() { 15 | return age; 16 | } 17 | 18 | public void setAge(int age) { 19 | this.age = age; 20 | } 21 | 22 | public String getAddress() { 23 | return address; 24 | } 25 | 26 | public void setAddress(String address) { 27 | this.address = address; 28 | } 29 | } 30 | 31 | public class Mock_test_2_java_PPT_PW_skills_First_Question_Public { 32 | public static void main(String[] args) { 33 | Person person = new Person(); 34 | person.setName("John"); 35 | person.setAge(30); 36 | person.setAddress("123 Main St"); 37 | 38 | System.out.println("Name: " + person.getName()); 39 | System.out.println("Age: " + person.getAge()); 40 | System.out.println("Address: " + person.getAddress()); 41 | } 42 | } --------------------------------------------------------------------------------