This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I want to use Printable class in my program. But I have a problem in the scope of variables used in the program. How to define variables/classes as 'Friend' in my class, so that I can access the values inside other classes. I have this concept in c++, but not in java. I have included both the classes in the same package. A variable calculated inside the printable class during printing process, cannot be accessed in my class.
Can please someone help on this. If with little highlevel example better.
If your question is related to this thread, then as I tried to tell you then, your problem has absolutely nothing to do with the scope of any variable. Your variable is very much in scope when you change it, you just don't call the method that changes it when you think you do.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter