Brian Reindel

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

Recent posts by Brian Reindel

I am reading chapter 2 of SCJP for Java 5, and I am trying to understand constructors. Would it be correct to make the following two statements:

Statement 1: Only an overloaded constructor can contain a call to "this()". For example, the following would throw a compiler error:



Statement 2: An overloaded constructor can contain a call to "super()".

Declaring enums is in chapter one of the book Sun Certified Programmer for Java 5 Study Guide, but it appears there is no more detail on this concept within the book. If this is the case, can someone recommend a good resource for further learning about enum?

I'm having trouble understanding why you would not just use an interface with constants, instead of an enumerated list. What is the benefit the enum is offering? Thanks.

Originally posted by Harish Paravasthu:
Yes priya is right,Protected member in one package can be accssed in other package only by inheritance and not by reference of suerclass...

harish



Which would mean that my original two statements are correct.

Thank you for everyone's response and for the assistance.

Originally posted by Priya Viswam:
>>"A protected member of a class can be inherited by a subclass in a different package, but it cannot be referenced."

Protected member can be referenced in the subclass even if the subclass is in a different package.



Priya, if what you say is correct, then why in the book, does this cause an error:


[ January 04, 2007: Message edited by: Brian Reindel ]
I am jotting down notes while studying for the SCJP exam, and I want to be sure that I get this concept 100%. Would it be correct to make the following two statements:

"A default member of a public class can only be accessed by a class or a subclass within the same package."

"A protected member of a class can be inherited by a subclass in a different package, but it cannot be referenced."

If this is not completely correct, or you have alternate ways of stating these two rules, please let me know.

Thanks
I am jotting down notes while studying for the SCJP exam, and I want to be sure that I get this concept 100%. Would it be correct to make the following two statements:

"A default member of a public class can only be accessed by a class or a subclass within the same package."

"A protected member of a class can be inherited by a subclass in a different package, but it cannot be referenced."

If this is not completely correct, or you have alternate ways of stating these two rules, please let me know.

Thanks
17 years ago