Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package student;
  7.  
  8. public class Student {
  9.  
  10. String name,dept;
  11. int id;
  12.  
  13. Student(String n,String d,int i){
  14. name = n;
  15. dept = d;
  16. id = i;
  17.  
  18. }
  19. void info(){
  20. System.out.println("Name = "+name);
  21. System.out.println("Dep = "+dept);
  22. System.out.println("Id = "+id);
  23. }
  24.  
  25.  
  26. public static void main(String[] args) {
  27.  
  28. Student s1 = new Student("Ashik", "CSE", 120);
  29. s1.info();
  30.  
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement