Daniele Barell

Ranch Hand
+ Follow
since Sep 01, 2017
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
52
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniele Barell

Hi Luanrkiran kumar.

Luanrkiran kumar wrote:
I just want to know how the  above code works..and what to do to get rid of stack overflow error.



- a is an isntance of Bird, which is instantiated at construction of Bird object
- When you construct a Bird object a is instantiated calling the Bird constructor another time.
- So every time you call new Bird(), a is created calling new Bird() again.
- So for Bird bird = new Bird(), This code cicles endlessly creating an abject like bird.a.a.a.a.a.a.a.a ....

To escape this code you can change the code in various way.
One option I suggest is to set the variable a static
Hi ranchers!
At Sybex book on OCA by Jeanne and Scott at page 206 there's a JavaBeans naming convenctions rules sum up.
They seemed easy and clear to me.
But when I got the relative review question ( n. 9 ) on these convenctions I miserably failed.
So I wanted to make a recap of these rules like I understood it. And make some questions

- Instance variables must be private. But static ones?
- Getters: if the property is a boolean must begins with is OR get. ie: public boolean isHappy(){return happy;} OR public boolean getHappy(){return happy;}. Can you give me a confirmation about boolean getters?
if the getter is another about java type it must begins with get only.
- Setter methods begins with set. ok

The rest of the name for getters and setters is the name of the property encapsulated beginning whith capital letters:
So for example we have a property called numberOfExams the getter and setters must be called
getNumberOfExams() and setNumberOfExams;
but names that shorten the original one one are valid as well?
getNumOfExams() and setNumOfExams; are also valid for JavaBean naming convenctions?

Hope you'll make me clear. 


Great Score!
Congratulations!!!

Jeanne Boyarsky wrote:Which book is it? THere's an errata thread for the K&B 7 book. I suspect you are actually reading the OCA 8 (since you are also reading my OCA 8 book).

Regardless, can you post a question number. And a chapter number or that it is from the mock exam.



Hi Jeanne,
I'm reading about OCA 8 as you supposed.
This question is cought by the interactive quiz, not by the book directly.
As Campbell said the exam application didn't show a unique id of the question, and I composed the test mixing some cerctification-objectives.
But I detected a little more de-randomizing questions and find out it's the 12th question belonging to the "Java Basics" group.
That's the best coodinates I'm able to give.

Campbell Ritchie wrote:I think you might be right there.



Hi Campbell,
Thank you.

Do you know if there's a way to let it know to Oracle/Mc Graw Hill or direclty to Kathy Sierra/Bert Bates?
Hi ranchers!
I post in attachment a question whose result I cannot fully understand.

In particular the third check point (option E):

Class Benefits2 uses some of the Java API outside of java.lang




My humble point of view is that Benefits2 uses an int for counter and a String for bene and anything else.
In TestBenes Benefits2 IS USED BY a java.util.ArrayList to populate itself. Benefits2 is used by ArrayList and doesn't use ArrayList.
So option E should not be true.
Am I missing something?
Hi Ankur!
Thanks for the clear answer!

Ankur R Jain wrote:
The reason this one compiles, is the fact that it is catching Exception in the catch block, which can also catch RuntimeExceptions, which the compiler won't be aware about, so it doesn't treat this catch block as unreachable and allows the code to compile.



So we could safely try and catch the basic Exception all the time because it can also catch RuntimeException which could be thrown by any called method without the need to declare it. Do I correcly understand?
In fact re-writing the Bunny class like that:

It compiles.

But at this point I cannot see the need, at design time, to define the Exception type a checked exception itself. Isn't it sort of misleading?
Hi ranchers.
I'm reading Jeanne and Scott OCA book.
In the last pages dedicated to Exceptions there's a pair of examples I cannot fully understand.
The first code is like that:

It doesn't compile because eatCarrot() doesn't declare a NoMoreCarrotsException and there's really nothing to try and catch in the main method.
Following the compiler rant:
Bunny.java:7: error: exception NoMoreCarrotsException is never thrown in body of corresponding try statement }catch(NoMoreCarrotsException e){
The book regularly explains it.

The second example, few pages later, is dadicated to exceptions printing and it is like that:

This one compiles.

But wait!

hop() like eatCarrot() doesn't declare any exception!
So why the compiler doesn't rant anything about Exception handling in the main method? Isn't it the same case of the first example?
I'm confused.

Peter Potter wrote:HI to all,

1.I read somewhere that people who are non native english speakers have additional 30 minutes on the exam , is this still valid? I cannot find any information on this now...




This is the comunication I made with PersonVue:


Hi,
I'm going to take a test for Oracle, the 1Z0-808 exam.
Among the available exam languages I will choose English, but I'm Italian.
So I need to know if there is a time extension of the exam for people like me who are not native English speakers.

Thank you in advance.

dan



This is the answer I got this afternoon:


Hello Dan,

The Oracle Exam program does not offer the ESL time extension so this would not be an option.

Please let us know if you have further questions.

Thank you,
Accommodations Team
Pearson VUE



So the definitive anwer is NO. You got 2 hrs and a half to take the exam consisting in 70 multiple choice questions weather or not you're English mother tongue.

Bravissimo Mario! 
Congratulations! It's the end of a very long road!


9 months ago

Peter Potter wrote:HI to all,

1.I read somewhere that people who are non native english speakers have additional 30 minutes on the exam , is this still valid? I cannot find any information on this now...



Hi Peter,
There is the chance to ask directly to Person Vue at contact center
I myself am interested in the question, being from Italy...
Thanks Jeanne.
For now OCP is in the outer space...

Campbell Ritchie wrote:

Daniele Barell wrote:. . . The answer is false but it's a nuance as the a the type IS-A String . . .

That is the usual behaviour of instanceof which you can read about in the Java® Language Specification (=JLS). It also tells you what the result of adding apples and oranges in your example would be. You need to know about how instanceof behaves when presented with a null as its right operand in order to write a correct equals() method.



Hi Campbell!

I can see JLS is fundamental... but don't you feel  when you read it?

Liutauras Vilda wrote:Ok, I see your concerns. These might be valid. But I'm still on the same, I'd say just go through this topic, finally it shouldn't extend your learning efforts significantly in the full context of preparation.

One of my professors in uni (it was Software and Programming III module) some time ago said: "You'll struggle in this module due to the material size it covers and courseworks it contains, most likely you'll curse me, some of you, actually most of you will hate me - and finally you'll thank me after some time.". I did my last part

Appreciate what you manage to learn and actually understand during the preparation, so go for it without a second thought.

Also, in case things happen, don't concentrate on side pieces as what material they give during exam, they give one pen or two, why they don't give three. Do they allow take notes out, why not. Can you do that or that, is mouse wireless or cordless or laser... - saying this because you'd be surprised how much energy people spend finding out those things.


Liutauras I must thank you for the wise and kind words you spent on this post.
I've had no teachers to hate or thank in programming, I studied graphic and advertising and now I'm struggling to become...I dunno... a sort of self made programmer. Maybe I only liked the metaphor of travelling in a peculiar land of knowledge.
I was in doubt if posting this question this morning because I knew it was a relatively small subject. Yet I did it also because I know some intersting excursiveness can bear in these saloon!

Liutauras Vilda wrote:
Get knowledge, and other things will have less and less significance. Good luck on exam. Don't forget to come back so we could congratulate you To most of people I say, don't give pressure to yourself - be prepared to lose also, and in case that happens, remember - it isn't the end, once you put efforts, good day will come sooner or later. Don't put too much weight on the exam. Just go for fun and for a nice puzzle challenge day.


I feel I'm not prepared for the exam still. Most of the time I try a few questions from a mock exam I feel very uncomfortable, disorientated. It's not a mere knowledge problem.
Maybe I consider it too important.  

Liutauras Vilda wrote:
When you finish with book - I'd recommend to get some mock tests to get some actual sense of the exam flow, so that would be useful for sure.


OK!

Campbell Ritchie wrote:Moving out of the results forum.


Oh! Sorry...