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.
If I call a method in ClassB from main in ClassA, why is it that both classes must be in the same package, and ClassB must extend Class A? I found all of this out tonight (the hard way), when I finally got my main method to call a function in another class. The ONLY way it would compile and run was to declare both class files in the same package, and have the called class (containing the function I was calling)to extend the class containing main (the caller). Can anyone tell me why Java requires all of this?? No wonder this language is so difficult to grasp by just reading Java books?