• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

1.4 certification objectives

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In a 1.4 mock exam I found:

What will the output of the following program:


Can anyone tell me to wich (1.4)Certification objective this question refers?
Regards,
Matthias
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These unnamed blocks are initializer blocks, which I think fall under "Language Fundamentals."

If the block has a "static" modifier, it will execute when the class is loaded. Otherwise, without a "static" modifier, the block will execute when an instance is initialized (before the body of the constructor).

I've modified the code to demonstrate this. Note that when an instance is created, the non-static initializer block executes before the constructor body. Also note that the static block only executes once, when the class is loaded (which happens when the static main method is invoked). So creating a second instance does not cause the static block to execute again.
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's interesting is that init blocks are on the 5.0 exam but they're NOT on the 1.4 exam!

Anyway, I would strongly recommend that you study for the 5.0 exam, not the 1.4.
 
Matthias Wendel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's because I'm under pressure what concerns my resources of preparation time. And everybody is saying the 5.0 exam is more difficult. What are the main arguments to do the 5.0 exam?
Regards,
Matthias
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The current version of Java is version 6, and it has been out for almost a year already. So with Java 1.4 you are two releases behind the current version.

In Java 5, a whole list of new language features have been added. More and more Java projects are being done with Java 5 or Java 6, and if you're going to work on such a project you'll be expected to know those new features.

So an SCJP 5 certificate is worth more and will last longer because it's more current.

Suppose you're on a job interview and you're asked "Why did you do SCJP 1.4 instead of SCJP 5?". Are you then going to answer "Because it is easier"? That wouldn't leave a good impression...
[ November 08, 2007: Message edited by: Jesper Young ]
 
Matthias Wendel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you - I'll think it over.
Regards,
Matthias
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic