Advertisement
shawonrog

SimpleOOP

Feb 26th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. package springpractice;
  2.  
  3. public class oop1 {
  4.  
  5. public static class teacher{
  6. String name;
  7. String phone;
  8. String gender;
  9. public void ds(String name){
  10. System.out.println(name);
  11. }
  12. void display(){
  13. System.out.println(name);
  14. System.out.println(gender);
  15. System.out.println(phone);
  16. }
  17. }
  18.  
  19. public static void main(String[] args) {
  20.  
  21. teacher tc=new teacher();
  22.  
  23. tc.gender="Male";
  24. tc.name="Dr.Md.Kamal Pasha";
  25. tc.phone="0178723456";
  26.  
  27. tc.display();
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement