Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Charissa Thomas

Greenhorn
+ Follow
since Jul 12, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charissa Thomas

That's amazing.  Congratulations!
5 years ago
Thank you Jhonson!!  Just ordered my T-Shirt, lol.
5 years ago
Thank you so much Prashanth and Paul!
5 years ago
Thank you very much!
5 years ago
I am happy to report that I passed the OCA 7 exam!  YEA!!  Thank you to everyone here who posted and answered questions for this exam.

My main sources for studying have been this site as well as the Oracle Press OCA/OCP Java SE 7 Programmer I & II Study Guide by Kathy Sierra and Bert Bates.  I studied for about 4 weeks straight.

I am now moving onto the OCP 7 exam.  Thanks again!
5 years ago
E is correct because it is only talking about encapsulation in that answer.  A setter is not required in order for a class member to be considered encapsulated.  The accessibility of the class member is how encapsulation is determined.  Can the class member be accessed directly without the class that owns it knowing?  This is what public access allows.  As soon as you set it as private, it is encapsulated and any changes to that member have to go through the class that owns it.  The presence of a setter method denotes a member as immutable or not (unless there are other methods that manipulate that member).
If you really want to work with the concrete type instead of the interface, you can always cast the returned object before assigning:

Completely forgot about that.  Thanks a bunch for your quick response!
I am ready the OCA 7 certification study book and read that you can have up to 21 digits in an octal number, not including the leading zero but when I tried to compile this line:



I got the following error:

Octal.java:8: error: integer number too large: 0111111111111

Please advise how I would write a 21 digit octal number or if this is incorrect, I will need to report that for the books errata notes.  Thanks for anyone's guidance!