Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

creating objects of classes

$
0
0
Hello,

Ok i am totally braincramping here..

If I have 2 classes (class A and class B )

I want to reference class B from class A so I do this:

classB B = new classB();


then i use A.xxx to reference into class B

BUT...

when I want to reference from class B to class A,
when I do this:
classA A = new classA();

the thing just starts to build JFrames in an endless loop..

now I don't want to just use classA.xxx because then I get into a static war with my program and eventually I have EVERYTHING static and it just becomes a nightmare..

so how do I reference back to a class without getting the endless loop and without making the entire program static??

Thank you
Bob

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>