Fall 2020 – Computer Programming
Lab Assignment # 8
Topic covered: Class and Object in java
Last Date of Submission: 08/12/2020
Special Instructions-
Program should be well commented.
Program should be easy to use.
Use java code convention to giving name to class and variables.
Only .java file should be uploaded on eclass other extension file will get ZERO score for assignment.
Write java program to create class Student with data fields with (StudentID, Student_Name and Age) and methods getStudentID(), setStudentID(), getStudentName(), setStudentName(), getAge(), setAge() and two constructors with out argument and with arguments.
Student
|
-StudentID:int
-StudentName:String
-Age:int
|
+Student()
+Student(int,String,int)
+getStudentID():int
+setStudentID(int):void +getStudentName():String +setStudentName(String):void
+getAge():int
+setAge(int):void
|
Create another class StudentDemo with main method. In main method demonstrate object creation and use method of Student.
StudentDemo
|
|
+main(String[] args):void
|
Upload both Student.java and StudentDemo.java files or you can combine both program in one file and upload while submitting assignment in eclass.
Do'stlaringiz bilan baham: |