Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pkgday3;
- class StudentClass
- {
- public void Name(String Name)
- {
- System.out.println("name of Student:" +Name);
- }
- public void StudentId(int StudentId)
- {
- System.out.println("StudentId of Student:" +StudentId);
- }
- public void CourseId(String CourseId)
- {
- System.out.println("CourseId of Student:" +CourseId);
- }
- public void Gender(String Gender)
- {
- System.out.println("Gender of Student:" +Gender);
- }
- public void PhoneNum(int PhoneNum)
- {
- PhoneNum=12345;
- System.out.println("PhoneNum of Student:" +PhoneNum);
- }
- }
- public class Q4
- {
- public void HostelName(String HostelName)
- {
- System.out.println("HostelName of Student:" +HostelName);
- }
- public void RoomNum(int RoomNum)
- {
- System.out.println("RoomNum of Student:" +RoomNum);
- }
- public void PhoneNum(int PhoneNum)
- {
- System.out.println("PhoneNum of Student:" +PhoneNum);
- }
- public static void main(String[] args)
- {
- StudentClass s1=new StudentClass();
- s1.StudentId(111);
- s1.Name("Sname");
- s1.CourseId("CId");
- s1.Gender("Male");
- Q4 h=new Q4();
- h.HostelName("HostelName");
- h.PhoneNum(13579);
- h.RoomNum(909);
- }
- }
Add Comment
Please, Sign In to add comment