Lập trình hướng đối tượng Java: biểu diễn đối tượng bằng sơ đồ lớp | Codelearn

  • TuanLQ7
  • Easy
  • 100 Points


Create a Student class within the Student.java file with the following information:

Explanation: The table above describes the Student class with the following attributes and methods as below:

  • name and age are attributes with private modifier.
  • Student() is a no-arg constructor with public modifier.
  • getInformation() and display() are methods with public modifier.

In fact, you should not store the two classes in the same file as in the previous lesson (Student class and Entry class are written in the same file). For each class, you should create its own file. For example, the Student.java file contains the code block of the Student class, the Entry.java file contains the code block of the Entry class, ...

Back in the exercise, the code window in this article is the Student.java file, in this file you need to create a Student class with the same properties and methods as described (you only need to declare the attributes. methods and methods, no need to write code inside the method).

Note: when submitting articles to the system, you do not need to declare the package.