Help coderanch get a
new server
by contributing to the fundraiser

Ahmad Yazdankhah

+ Follow
since Jul 30, 2011
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ahmad Yazdankhah

OK, now it's clarified that when you say package-private, you don't mean package or private. That's called default modifier in the most Java documents.
Yes, the class I was talking about must be public in order to be visible by the whole application.

Can you define your main class private?!
I think your main class must be public.
Java certainly supports global variables but in its own way.

Just define a public static variable in your main class (even though I don't recommend), then all your application can access it.

Does it work fine?

I want to add something important to all guidelines given above. It looks a little bit confusing.
Sierra/Bates book (study guide, I mean) is wonderful but not for somebody who wants to start Java.
Use the other book (head first) to learn the basics of the Java first, then start "study guide" book.

Good luck!

To clarify your question, can you provide a piece of code?
12 years ago

Do you expect a piece of code for this?
I don't get what you mean by: please help?
What's your question?
12 years ago
You should look at the execution of blocks when your class inherits from other class.
Your point is true when there is no inheritance.