Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Drag & Drop: what about the order of elements to place within the code fragment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Drag & Drop: what about the order of elements to place within the code fragment?" Watch "Drag & Drop: what about the order of elements to place within the code fragment?" New topic
Author

Drag & Drop: what about the order of elements to place within the code fragment?

Ulrich Vormbrock
Ranch Hand

Joined: Apr 15, 2010
Posts: 73
Hello,

revising the exercises from Chapter 6, page 530-531, K&B 6, I noticed that (theoretically) it should be possible to place the elements in different ways ... so in my opinion there is no absolute uniqueness concerning the solution.

Let's consider the following cases (from K&B Self Tests):

1) Try-catch-Block: it's also possible to surround with try/catch ONLY the piece of code (for example "file.createNewFile()") which really throws the exception, instead of surrounding the entire block.
2) Imports: the order of imports doesn't matter (import java.util.*; import java.text.* is the same as import java.text.* and java.util.*).

What about the real exam?
Does the order (into which I drag the elements) affect my score?
Is the "machine" lenient enough, taking into account that there might be not only one solution - provided that I use the minimum of slots?


SCJP 6 (88%), SCWCD (89%)
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

If there are any questions requiring you to put imports in a drag and drop questions, then most likely there will be a single import to put. If indeed there are multiple imports to fill, then the order won't matter. If you are asked to put try-catch around some code, then there won't be two spots where you can put the try-catch statements. Generally there are no extra blanks which are leftover after you fill the required code, so you won't have a condition where you can put a try-catch block around a single statement or a group of statements. You'll have only enough blanks so that you can put the try-catch at one place...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ulrich Vormbrock
Ranch Hand

Joined: Apr 15, 2010
Posts: 73
Hi Ankit,

thank you very much for your answer!
Yes, it's sounds rather logical as you've described ... so I can breathe a sigh of relief and address myself to the very important things concerning exam cram!

Cheers!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drag & Drop: what about the order of elements to place within the code fragment?
 
Similar Threads
java.io Mini API and Exceptions
Question on NumberFormat
doubt in parsing
java.awt.*; and java.awt.event.*
Reg. Exception hierarchy