• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Does the OCAJP use identation or not ?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

Question is in the title, I see a lot of mock questions not use the indentation.
Is it a thing ?
 
Rancher
Posts: 3615
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be prepared to different styles of code: e.g. a very long lines of pipelines, or several statements in a single line, or tricky indentation.

Assume such code:



(hopefully you were not tricked 8-)
 
Robin Louis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer, not every question will be an indentation trick tho, right ?

Because every question in a book i'm reading just omits indentation, like the following question

What is the result of the following code?

so I wonder if every question will be like that or if it is intended to train me to the indentation type of questions.
That doesn't bother me that much for that question but when there is much more code that's kind of hard to read when the point of the question isn't even reading correctly the indentation
 
Enthuware Software Support
Posts: 4428
41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Robin Louis wrote:Thanks for the answer, not every question will be an indentation trick tho, right ?


No, not every question but you won't know which one is trying to trip you on that. Mostly, the if/else questions is where you have to be more careful.


Because every question in a book i'm reading just omits indentation, like the following question


If it is an ebook, it could be a formatting issue with the book or the ebook reader s/w. Which book is it?
 
Robin Louis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Anilprem wrote:

Robin Louis wrote:Thanks for the answer, not every question will be an indentation trick tho, right ?


No, not every question but you won't know which one is trying to trip you on that. Mostly, the if/else questions is where you have to be more careful.


Because every question in a book i'm reading just omits indentation, like the following question


If it is an ebook, it could be a formatting issue with the book or the ebook reader s/w. Which book is it?



The online exams included with "OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide : Exam 1Z0-808" written by Jeanne Boyarski and Scott Selikoff.
They do indent the questions in the book though, it's only the online questions that have absolutely no indentation. Maybe it's not on purpose, I don't really know.
 
author & internet detective
Posts: 39996
807
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robin,
Not on purpose. The PDFs we reviewed and the printed book all have indentation. The Kindle book "lost" it. We don't know why.
 
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Robin,
Not on purpose. The PDFs we reviewed and the printed book all have indentation. The Kindle book "lost" it. We don't know why.


If kindle version is on .mobi format, i think this format lets the device calculate 'landscape' of text based on letter size and free space, making indentation a mess.
Try pdf version on Kindle (of course, loosing this auto-fit capability).

But this, far from a handicap, could be an advantage. If you can read code without indent, your chances to read it properly (and understand it) on exam increases.
 
Robin Louis
Greenhorn
Posts: 11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Robin,
Not on purpose. The PDFs we reviewed and the printed book all have indentation. The Kindle book "lost" it. We don't know why.



Thanks a lot for your answer !

My OCAJP is scheduled for the 18/06, I'll let you know if that crazy indentation made me the OCAJP big boss.

Have a great day everyone.
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic