Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Day 2/ OCA Java SE 8 Programmer I Cert Promo: Prepare for the exam with 'Twist in Tale' exercises

 
Mala Gupta
Author
Ranch Hand
Posts: 363
11
  • Likes 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers -

To earn the OCA Java SE 8 Programmer I Certification, you should know your Java inside and out. One of best ways to do that is to write a lot of code.

Because a book can't cover all the possible code combinations on which you can be tested in the exam, I've included 'Twist in the Tale' exercises in my book.

Each chapter includes 4-6 such exercises. For these exercises, I’ve tried to use modified code from the examples already covered in the chapter. The Twist in the Tale title refers to modified or tweaked code. These exercises will help you understand how even small code modifications can change the behavior of your code. They should also encourage you to carefully examine all the code in the exam. The reason for these exercises is that in the exam, you may be asked more than one question that seems to require the same answer. But on closer inspection, you’ll realize that the questions differ slightly, and this will change the behavior of the code and the correct answer option!

To get you going, I've created an example for you to answer:



--------------------------------------
Twist in the Tale - Example 1
--------------------------------------

Given that the following example would concatenate and output the first and second command line parameters:


What happens, if you modify the preceding code to the following:


--------------------------------------
Twist in the Tale - End of Example 1
--------------------------------------

(Next example to follow in an hour.)

With much respect,
Mala





 
Mala Gupta
Author
Ranch Hand
Posts: 363
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the next question:

--------------------------------------
Twist in the Tale - Example 2
--------------------------------------

Given that the following code will output false:



Do you think the following code will output the same result?



--------------------------------------
Twist in the Tale - End of Example 2
--------------------------------------

Next example to follow soon.

With much respect,
Mala
 
Mala Gupta
Author
Ranch Hand
Posts: 363
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an example of 'Twist in the Tale' exercises from my book 'OCA Java SE 8 Programmer I Certification Guide':



These exercises encourage you to look beyond the code that you read. It encourages you to see how small changes affect code.

Because this is what you you'll experience in your real life projects.

With much respect,
Mala
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic