Jakob Bosshard

Greenhorn
+ Follow
since May 30, 2000
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 Jakob Bosshard

Hi
Yeah, that's a tricky one:
inc.fermin(i);
the call to the method does not affect i, because you pass only a copy of the primitive. (I think you got that one)
i = i++;
Actually, you would never write such a statement but rather
i += 1; //sets i to 1
or
i++; //sets i to 1
The explanation is as follows:
i is assigned to itself before i is incremented (post-increment). The machine
caculates the right side first and then assigns the result to the left hand side which is i. Statement finished. That means that the increment which takes place after the assignment
has no effect at all. I think that is the way the compiler
handles such statements.
Note that this would work:
i = ++i; //i is now 1
Does it help or am I too confusing this morning?
SEEYA
Jakob
Hi Mallesh
I think the difference is tiny. Both main() define the main entry of the user excution thread and actually are rather losely coupled to the class they are defined with or in. I wouldn't worry much about the different positions of the main().
Inside the main you can do anything you like. Instantiate any class etc. as long as they are visible to the main(). Of course,
the class the main is defined with is visible by default.
Maybe this is no good answer to your question. Could you be a little bit more precise what you want to know?
SEEYA
Jakob
Hi Chidananda
Congratulations to you! Don't worry about the score, main things is that you have passed. I missed the exam in the first trial with 69% which is just 1 question below the magic. Now I did it the second time and much better.
Take care
Jakob
Hi peeyush
I can recommend that you really focus on the topics published
in the official objectives of Sun. I couldn't find any question
that was not covered by those objectives. Make sure you are comfortable with every single point.
http://suned.sun.com/USA/certification/progobj.html#Java2
Good Luck
Jakob
Hi Monty
Regarding the Math class:
The class is final but the constructor is private, that is why
you cannot find any constructor in the API Doc. Constructors can
definitely not be final. Any book will tell you so or
just simply try the following code:
public final class FinalConstructor{ //o.k.
final FinalConstructor() {} //illegal
}
This will give you a compiler error that states what
constructors cannot be: final, native etc.
Do you agree?
Regards
Jakob
Hi
If you pass an object to a synchronized section you can
be sure that only one thread can handle it at that particular
moment. This enables you to do some critical operations on the object.
If you have different objects (different types) in the
same synchronized section you may have to find out who
they are using 'instanceof'.
Personally I think that blocks of synchronized code is just
bad programming style. There may exist some special circumstances
that might make them necessary. Otherwise I would recommend
to write a separate method.
Regards
Jakob
Congrats Satya
Great job!!! I did it yesterday, too.
Don't worry about the score, yours is just great. The score does
not tell much. Main thing is you've passed.
take care
Jakob
Hi neo
Mock exams are one thing to keep trying. The others I can recommend:
a) go through the official objectives by Sun and see whether
you are comfortable with all the points.
b) write some code on each category. You will remember much
easier what works and what not at the exam when you've
programmed it yourself. That helped me a lot.
c) At some point you just got to try and do the exam...
Regards and good luck
Jakob

Originally posted by Sankar S:
[B]Hi Neo,
Constructors of Math class are defined final, so that it cannot be instantiated.
That is not true. The constructor is defined private so
you can't instantiate it. Constructors are not allowed to be
final.
Also you cannot subclass Math class.
That is true and the effect of final
Regards
Jakob

Hi Sunita
The hexadecimal representation is for the convenience of the
programmer for assignment and output. Internally ints are stored as bytes (binary). Two things on changing the representation:
int i = 0xFF;
System.out.println(i);
This will display the int as a decimal.
The wrapper class java.lang.Integer offers a few conversion methods (mostly static) that allow you to output the Integer in any of the representations returning a string.
int i = 10;
String s = new String(Integer.toHexString(i));
System.out.println(s);
Finally you can parse an int from a string giving the radix you want to use:
int j = Integer.parseInt("FF", 16);
System.out.println(j);
//output is 255
Just write some code with the java.lang.Integer class and find
out about all the representations.
Hope this will help
Regards
Jakob
Hi
There is no such thing as a virtual constructor in Java. Since constructors are related to a particular instance the following rules apply:
Constructors can't be abstract, native, static, synchronized or final.
However, Java does not prevent you from defining a non-abstract constructor in an abstract class. Note that you cannot instantiate an abstract class but you can use it as follows
in a class hierarchy:
The following code illustrates the assigment of a non-abstract
subclass to an abstract superclass. So you can't have abstract
constructors directly but in this sense it works fine.
public abstract class AbstractTest {
int i;
public AbstractTest(int i) {
this.i = i;
}
public static void main(String [] args) {
AbstractTest test = new AbstractTestChild(1);
}
}
class AbstractTestChild extends AbstractTest {
public AbstractTestChild(int i) {
super(i); //works
}
}
Hope that this helps
Regards
Jakob
Hi Sandra
Hi maha anna
Thank you so much. I really appreciate it. Feels great the day after certification.
Regards
Jakob
Hi
1)does the time(2hrs) include the statistical based questions

What do you mean?
2)is there any fixed order of difficulty level, eg. are the initial questions short and in true and false, and towards the end you see questions with several lines of code.
Nope. They are all mixed up.
3)is there any fixed no. of questions for T/F Multiple choice..or even text fill questions.....
I don't think they are fixed but you can assume that there
are not too many fill questions. I had about 4 or 5.
4)can I get a T/F question followed by a text question followed by another text question....ie., is there something like all T/F questions first then Multiple choice...etc
Nope
5)Is there something unusual that I should be aware of...besides the general more familiarly known stuff realted to the test..
I can just recommend that you carefully read the assignment even if it seems obvious what's meant. I had to correct two questions
in my review because I did not get the real meaning the first time.
There are not trick questions but you really have to know things well, the answers are sometimes quite ambiguous.
Good Luck
Jakob
P.S. Please register!
Hi folks
Today I've passed the SCJP with a score of 92%. This after having failed two weeks ago with a score of 69%. I am very happy it turned out so well and am thankful for this forum which is great. It's good to know that other people are trying hard, too.
With this message I want to encourage everyone in this forum to try it a second time if you fail the first or even a third time if necessary. Apart from having realized that I had to fill some gaps of my knowledge after the first trial I give the following advice:
Carefully carefully read carefully the assignment question. Although trivial, I corrected two questions in the review this morning because I suddenly realized that the sense was different.
All the best
You can get it if you really want
Jakob