| 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
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
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!
|
 |
 |
|
|
subject: Drag & Drop: what about the order of elements to place within the code fragment?
|
|
|