Homework 4: Working with Classes, Methods, and Constructors

Due Date: [11/16- 11:59 PM]

Task Overview

Create a Java program to practice object-oriented programming concepts like class, attributes, constructor, and methods.

  1. Create a class named StudentData.
  2. Define three attributes: studentId, name, and age.
  3. Initialize the attributes with default values using a constructor.
  4. Create getter and setter methods for all attributes.
  5. In your main class:
    • Create the first object using the default constructor.
    • Use the getter methods to display the student information.
    • Create the second object by passing values using a parameterized constructor.
    • Use methods to print the second student's info.

Expected Output

Expected Output Screenshot

Submission Instructions

  • Include your full name and email at the top of your file using a comment tag.
  • Compile and run your program, ensuring all output matches the sample.
  • Take a clear screenshot of the result.
  • Zip your project folder, including the source code and screenshot.
  • Upload the zipped file to Blackboard before the due date.