Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class A {
- private B b;
- public void setB(B b){
- this.b=b;
- }
- /*public void setBB(){
- b=new B();
- }*/
- }
- class B{
- String bab;
- public B(String ba){
- ba=bab;
- }
- public static void main(String args[]){
- A classA=new A();
- B classB=new B("hello");
- classA.setB(classB);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement