Ivan Vrtacnik

+ Follow
since Sep 02, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ivan Vrtacnik

Originally posted by Devaka Cooray:
Hi Lidija,

Congrats on your result.

However, I cannot agree with the following sentence:

There may be some similar questions in my simulator, but there can never be completely identical questions, which violates the Sun copyright laws. Because I didn't use 'any' resource for my questions.

No, it is true. I had an identical question:

printf("%s, %b", Math.E, Math.PI);

On both the ExamLab and the exam itself. Only difference was that on the exam it was a drag and drop, while on ExamLab it was a multiple choice.
10 years ago
And to think that when I sat at the computer, I was certain I would fail!
As I kept going, I was surprised how easy the questions were. By sections I had:

Declarations, Initialization and Scoping.........91%
Flow Control.....................................72%
API Contents.....................................60%
OO Concepts......................................80%

Also, I can atest to the fact that mock exams ARE harder than the real thing by at least 20%!

This might even be the best score of my group, the guy everyone thought would be the best is actually 1% behind me. I will know on Janury 10th, so we will see.

Many thanks to the Algebra (Zagreb, Maksimirska 58a) staff for their great training course and help throught my preparation, IT Courseware for their fine textbooks and Deevaka Cooray for his excellent (though sometimes erronous) ExamLab!
[ December 21, 2008: Message edited by: Ivan Vrtacnik ]
10 years ago
I have been told that using

main(String... args){}

is not a legal way to use the main method. But now I have twice seen it in unrelated sources and don't know what to think! Please help me!
I readily admit to knowing less about Indian personal names than you ,
so my apollogies to Hansika!
Oops, I forgot we need an object as well as a reference of the outer class. I'll correct that.

This however is still a little tricky, so I'm not sure either, but what you are describing is accessing an inner class declared inside a class. Here however the class is defined inside an interface which cannot create it's own objects. What we would need for that is an object of a class implementing the interface, which in this case can only be Test (now I see the confusion about this!).

So the correct synthax is in fact:

Test implements I1{

I1 a = new Test();
a.innerclass in = new a.innerclass();

It is possible to declare a reference of an interface type and use it to refer to any object that implements the interface.
I think he asked the question wrong. If I understood correctly, he wants to access the contents of a package from another package. This is done with imports.
That too is illegal. I1 cannot be used to reference innerclass, since this designates a type, not a reference variable. It would be possible to do so only if innerclass was made static.

Besides, calling a method of the superclass from a subclass does not involve using the keyword this, but super.
Not possible since Test is not a child of innerclass.
It is simple even on concept level. Sub.ID is a call to a static variable of class Sub named ID. Sub inherited this variable from class Super. The two concepts behind it are is simply "how to make calls to static variables" and "subclasses inherit fields and methods from superclasses"
Or, use a interface reference and a implementing class object:

I1 a = new Test();
a.innerclass in = new a.innerclass();

A bit more code, but better understanding.
[ November 27, 2008: Message edited by: Ivan Vrtacnik ]
From what I know, a finally{} must be placed below all catch{} blocks. It's in fact a compiler error to do otherwise, at least in NetBeans.
So static members and fields are called from the reference, and methods from the object, is that what you're saying?
If I understand correctly, a is a Test reference to an Arabik object. And the question is why does a.i call the i field of Test and a.getI() calls the getI() of Arabik?
Thank you. I'm actually going for 1.6
In the rules roundup game, I encountered a class access modifier 'friendly'. But when I asked my instructor about it, he said this modifier does not exist in Java, and the behaviour of this modifier indicates that it is actually the modifier 'package'.

Who is right?