I have following UML class diagram and java coding for each, please tell me is my coding are correct or incorrect according to the diagram,

[Diagram 1]
Class A{
B b = new B();
}
Class B{
A a = new A();
}
[Diagram 2]
Class B{
private void methodA(){
A a = new A();
}
}
Code1
Code2
}