Advertisement
ismail5g

Question-7

Apr 14th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. class Test{
  2.     int a;
  3.     public int b;
  4.     private int c;
  5.     void setc(int i){
  6.         c=i;
  7.     }
  8.     int getc(){
  9.         return c;
  10.     }
  11. }
  12.     class test2{
  13.         //you can take this class or you can delete it
  14.     }
  15.     class Bank{
  16.         public static void main(String args[]){
  17.         Test ob = new Test();
  18.         ob.a=15;
  19.         ob.b=20;
  20.         ob.setc(100);
  21.         System.out.println("a, b, and c: "+ob.a+" "+ob.b+" "+ob.getc());
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement