007-001-010
Class Creation: Basic Structure
Easy
Problem Description
Class Creation: Basic Structure
In this problem, you will define a Person class with name (String) and age (int) fields.
Learning Objective: Understand basic class structure and definition
Overview
Create a simple class that has fields (attributes).
Specifications
- Create a
Personclass - Define a String field
name - Define an int field
age - Fields must be directly accessible from an instance
Testing
The system will create instances of your Person class, assign values to fields, and verify the results.
Example Output
Name: Taro
Age: 20
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up