Mila Snov

Greenhorn
+ Follow
since Jan 23, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mila Snov

Hi everyone,
I am preparing for SCJP 035 exam. Before I have read one of the topics here, I was sure that I only would need to book exam with Prometric, go there and pay. Should I buy exam voucher from Sun before? How can I do it? Simply buy it from Sun Web site? Can I do it somewhere else? I am sorry, but I am a little confused.
I am in Canada, Ontario.
Tell me, please, about steps I need to take.
Thanks a lot.
I got it. Thanks.
Hi,
Example from Kathy Sierra & Bert Bates books.
Given the following,
1. public class Test2 {
2. public static int x;
3. public static int foo(int y) {
4. return y * 2;
5. }
6. public static void main(String [] args) {
7. int z = 5;
8. assert z > 0;
9. assert z > 2: foo(z);
10. if ( z < 7 )
11. assert z > 4;
12. switch (z) {
13. case 4: System.out.println("4 ");
14. case 5: System.out.println("5 ");
15. default: assert z < 10;
16. }
17. if ( z < 10 )
18. assert z > 4: z++;
19. System.out.println(z);
20. }
21. }
which line is an example of an inappropriate use of assertions?
A. Line 8
B. Line 9
C. Line 11
D. Line 15
E. Line 18
The correct answer is only E, line 18. I am agree, but I think that B,line 9 also is an example of an inappropriate use of assertions. Am I wrong? Why?
Thanks.
Hi everybody,
I am preparing for SCJP exam and I have a question. There is the code:
public static void main(String[] args) {
char c = 'm';
int i = 3;
c += i; // line#1 compile and run fine
System.out.println(" c = " + c );
// c = c + i; //line#2 compile error
}
I understand why the line #2 gives the error, but I cannot understand why the line#1 compiles and runs fine. As I know both of this has the same meaning. Am I wrong?
Could somebody explain me how it works, please.
Thanks.