Paste Search Dynamic
Recent pastes
class student
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class main
  9. {
  10.         public static void main (string[] args) throws java.lang.exception
  11.         {
  12.                
  13.         }
  14. }
  15. class Student{
  16.       string s_name;
  17.       int s_grade;
  18.       int s_number;
  19.       string s_mail;
  20.       public Student(){
  21. system.out.println("=== Student CONSTRUCTOR-I ===");
  22. }
  23.       public Student(string n1, int g, int n2, string m){
  24.       system.out.println("=== Student CONSTRUCTOR-II ===");
  25. this.s_name = n1;
  26. this.s_grade = g;
  27. this.s_number = n2;
  28. this.s_mail = m;
  29. }
  30. public string getS_name(){
  31. return s_name;
  32. }
  33.  
  34. public void getS_name(string s_name){
  35. this.s_name = s_name;
  36. }
  37.  
  38. public int getS_grade(){
  39. return s_grade;
  40. }
  41.  
  42. public void getS_grade(int s_grade){
  43. this.s_grade = s_grade;
  44. }
  45.  
  46. public int getS_number(){
  47. return s_number;
  48. }
  49.  
  50. public void getS_number(int s_number){
  51. this.s_number = s_number;
  52. }
  53.  
  54. public string getS_mail(){
  55. return  s_mail;
  56. }
  57.  
  58. public void getS_mail(string s_mail){
  59. this.s_mail = s_mail;
  60. }
  61.  
  62. public void printStudentInfo(){
  63. system.out.println("Namet: " + getS_name());
  64. system.out.println("Gradet: " + getS_grade());
  65. system.out.println("Numbert: " + getS_number());
  66. system.out.println("Mailt: " + getS_mail());
  67. }
Parsed in 0.021 seconds