Skip to content

YuriiJavaDev/JavaBasics_Task_227_V0.1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

University Admin: Student Registration (JavaBasics_Task_227_V0.1)

📖 Description

In a multi-user system, a single class must support many independent objects. This project demonstrates how to use the Student blueprint to register two distinct individuals. By creating separate instances for "Hana" and "Greg," we illustrate how Java manages unique data for each object in the heap memory, ensuring that updating one student's information does not affect the other.

📋 Requirements Compliance

  • Class Definition: Created a Student class with studentName and enrollmentYear.
  • Multiple Instantiation: Successfully created two separate objects in the main method.
  • State Management: Assigned unique values to each student's fields.
  • Data Output: Displayed the information for both students in the required format.
  • Naming Conventions: Used PascalCase for the class and camelCase for variables.

🚀 Architectural Stack

  • Java 8+ (Object Instantiation and Field Access)

🏗️ Implementation Details

When we write new Student(), Java carves out a new block of memory. In this task, we have two such blocks. The variable firstStudent points to one block, and secondStudent points to another. This is the core of how software scales: one blueprint, thousands of unique records.

📋 Expected result

Name: Hana, enrollment year: 2022
Name: Greg, enrollment year: 2023

💻 Code Example

Project Structure:

src/com/yurii/pavlenko/
                ├── Student.java
                ├── StudentDataInitializer.java
                ├── StudentReporter.java
                └── StudentRegistrarApp.java

Code

package com.yurii.pavlenko;

public class StudentRegistrarApp {

    public static void main(String[] args) {

        StudentDataInitializer initializer = new StudentDataInitializer();
        StudentReporter reporter = new StudentReporter();

        Student firstStudent = initializer.createHana();
        Student secondStudent = initializer.createGreg();

        reporter.printStudentDetails(firstStudent);
        reporter.printStudentDetails(secondStudent);
    }
}
package com.yurii.pavlenko;

public class StudentDataInitializer {

    public Student createHana() {
        Student student = new Student();
        student.studentName = "Hana";
        student.enrollmentYear = 2022;
        return student;
    }

    public Student createGreg() {
        Student student = new Student();
        student.studentName = "Greg";
        student.enrollmentYear = 2023;
        return student;
    }
}

⚖️ License

This project is licensed under the MIT License.

Copyright (c) 2026 Yurii Pavlenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...

License: MIT

About

This is a tutorial project. JavaBasics_Task_227_V0.1 University administration system: instantiating multiple Student objects and managing unique state for each instance. 080326_1232

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages