Fall 2020 – Computer Programming Lab Assignment # 8 Topic covered: Class and Object in java Last Date of Submission: 08/12/2020


Download 15.64 Kb.
Sana28.10.2021
Hajmi15.64 Kb.
#169008
Bog'liq
08 - Lab Assignment - Class and Object


Fall 2020 – Computer Programming

Lab Assignment # 8

Topic covered: Class and Object in java

Last Date of Submission: 08/12/2020

Special Instructions-



  1. Program should be well commented.

  2. Program should be easy to use.

  3. Use java code convention to giving name to class and variables.

  4. 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.
Download 15.64 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling