Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Optimization Code (OCA JAVA SE 7 - Programmer I - Study Guide )

 
Devaney Marcondes
Greenhorn
Posts: 22
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.
I would like know, in your opinion, what is "optimization code".
In my opinion, to optimize a code means make a code with the "Best practices" as possible to do this code become more readable and MAYBE a faster program.
I make this question because in the book OCA JAVA SE 7 - Programmer I - Study Guide - Exam 1Z0-803 do Robert Liguori e Edward Finegan has a question that say:
Polymorphism helps to facilitate which of the following? (Choose all that apply.)

A. Highly optimized code
B. Code reuse
C. Code obfuscation
D. Code that is generic and flexible

The A is one of the answer that I marked, but the book say this answer is wrong and the explanation say:
"A" is incorrect because polymorphism has no effect on the level of optimization of the code.
In my opinion the polymorphism optimize the code and MAYBE not optimize the program.
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the answer given to this question and the reason please ?
According to me the answer is C. Code obfuscation.Please correct me If im wrong.
 
Devaney Marcondes
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Lal wrote:what is the answer given to this question and the reason please ?
According to me the answer is C. Code obfuscation.Please correct me If im wrong.


Answer:  Book answer is B and D. Polymorphism aids in creating reusable code, because it allows the code to be written more abstractly, thus B is correct. Similar to B, polymorphism allows the code to be generic by using generic data types that any more specific object can fulfill. Thus, D is also correct.
"A" and "C" are incorrect. A is incorrect because polymorphism has no effect on the level of optimization of the code. C is incorrect because obfuscated code (code that is intentionally difficult to read) is not related to polymorphism.

In my opinion, "A" is correct to. I don't agree with you that the answer "C" is correct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic