This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I looked at the above line in Exam 3, Question 45 of Marcus Greens Mock tests. I was wondering one thing.... How can the static method main() access the court variable of s? I tried placing a similar sample of code in my compiler, and was unable to compile it. By the way, the answer given is 4.
How can the static method main() access the court variable of s?
In the main method court variable is accessed thru the object which is fine but if you try to access the court variable without the object then it will give u compile time error saying that static method can only access static variables