Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. public class A {
  2. private B b;
  3. public void setB(B b){
  4. this.b=b;
  5. }
  6. /*public void setBB(){
  7. b=new B();
  8. }*/
  9. }
  10.  
  11. class B{
  12. String bab;
  13. public B(String ba){
  14. ba=bab;
  15. }
  16.  
  17.  
  18. public static void main(String args[]){
  19. A classA=new A();
  20. B classB=new B("hello");
  21. classA.setB(classB);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement