Skip to content

YuriiJavaDev/JavaBasics_Task_386_V0.1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Records: Record Accessors (JavaBasics_Task_386_V0.1)

📖 Description

Efficient data retrieval is a cornerstone of any administrative system. This project explores the Accessor Methods of Java Records. Unlike traditional POJOs that rely on the get prefix, Records provide accessors with the same name as the components they represent. This project demonstrates how to instantiate a Student record and retrieve its individual components using these automatically generated, concise methods, ensuring high readability and reducing boilerplate code.

📋 Requirements Compliance

  • Data Modeling: Defined a Student record with name and age components.
  • Accessor Usage: Utilized student.name() and student.age() to display data separately.
  • Modern Syntax: Adhered to the Java 16+ record standard for data carriers.
  • Template Standards: Followed the project structure, package declarations, and English documentation requirements.

🚀 Architectural Stack

  • Java 16+ (Records, Data Carriers)

🏗️ Implementation Details

  • Student: A record that encapsulates student identity and age.
  • UniversityLauncherApp: The entry point for creating and accessing student records.

📋 Expected result

Bob Grandel
20

💻 Code Example

Project Structure:

JavaBasics_Task_386/
├── src/
│   └── com/yurii/pavlenko/
│                 ├── app/
│                 │   └── UniversityLauncherApp.java
│                 └── university/
│                     └── models/
│                         └── Student.java
├── LICENSE
├── TASK.md
├── THEORY.md
└── README.md

Code

package com.yurii.pavlenko.app;

import com.yurii.pavlenko.university.models.Student;

public class UniversityLauncherApp {

    public static void main(String[] args) {

        Student student = new Student("Bob Grandel", 20);

        System.out.println(student.name());
        System.out.println(student.age());
    }
}
package com.yurii.pavlenko.university.models;

public record Student(String name, int age) {
}

⚖️ 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_386_V0.1 Student Records System: demonstrating data retrieval using built-in record accessor methods. 040526_1312

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages