Guest User

Untitled

a guest
Jun 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. package pkgday3;
  2.  
  3. class StudentClass
  4. {
  5. public void Name(String Name)
  6. {
  7.  
  8. System.out.println("name of Student:" +Name);
  9. }
  10. public void StudentId(int StudentId)
  11. {
  12.  
  13. System.out.println("StudentId of Student:" +StudentId);
  14. }
  15. public void CourseId(String CourseId)
  16. {
  17.  
  18. System.out.println("CourseId of Student:" +CourseId);
  19. }
  20. public void Gender(String Gender)
  21. {
  22.  
  23. System.out.println("Gender of Student:" +Gender);
  24. }
  25. public void PhoneNum(int PhoneNum)
  26. {
  27. PhoneNum=12345;
  28. System.out.println("PhoneNum of Student:" +PhoneNum);
  29. }
  30. }
  31. public class Q4
  32. {
  33. public void HostelName(String HostelName)
  34. {
  35.  
  36. System.out.println("HostelName of Student:" +HostelName);
  37. }
  38. public void RoomNum(int RoomNum)
  39. {
  40.  
  41. System.out.println("RoomNum of Student:" +RoomNum);
  42. }
  43. public void PhoneNum(int PhoneNum)
  44. {
  45.  
  46. System.out.println("PhoneNum of Student:" +PhoneNum);
  47. }
  48. public static void main(String[] args)
  49. {
  50. StudentClass s1=new StudentClass();
  51. s1.StudentId(111);
  52. s1.Name("Sname");
  53. s1.CourseId("CId");
  54. s1.Gender("Male");
  55.  
  56. Q4 h=new Q4();
  57. h.HostelName("HostelName");
  58. h.PhoneNum(13579);
  59. h.RoomNum(909);
  60. }
  61. }
Add Comment
Please, Sign In to add comment