Originally posted by Ajith Kallambella:
The break statement may not serve as an alternative to the return statement since it ( former ) can be used only in loop-structures.
Originally posted by alpa urja:
Thanks Latha
but in one of the sites(I don't remember the site name),they mentioned Extern as a keyword in JAVA......
<pre> that is dut to alpa-gyan </pre>
alpa-urja
Originally posted by Jane Griscti:
Hi Nasir,
The last line is 3 vs 2 because the superclass initializer is called before the subclass initializer or constructors.
<pre>
the line you have written is true in conclusion but that associated reason is wrong.not have any link with explaination.
</pre>
At that point in the compile the superclass is totally unaware of the fields which exist in the the subclass.
<pre> true </pre>
The field 'x' in the superclass is assigned the value 3; not the field 'x' in the subclass.
<pre>
that is absolutely wrong . </pre>
<pre>
in the original code the variable x is declared in both of the classes. so second one hides first one.and rest of all done due to flow of execution. i can explain in detail but i don't want to
west my valuable time in this particular thread.better i searched some sesnsible thread.
</pre>
Originally posted by Rosemol Thanjappan:
Hi,
Thankyou for the information.
It will be great help to get that clue.
Does any Deprecated ones since Oct.4?
Eg:-
In the above question stop(),suspend() are deprecated.
Thanking you
Rosemol.
Originally posted by Nasir Khan:
As output shows I assume that order of code execution is
=> static variables initialization and then static initializer block execution in super class.<pre> slightly missed </pre>
=> static variables initialization and then static initializer block execution in sub class.<pre> slightly missed </pre>
=> instance initializer blocks execution in super and then in sub class<pre> anah </pre>
The way I think about the code execution is correct...or something else goes on here..?
Also I think last line of output should be 2 instead of 3 because x just has been assigned a value of 2 in super's instance
initializer block...
Originally posted by Rajpal Kandhari:
Hello,
Wow Again for me Java is a funny Language.
Originally posted by Nasir Khan:
yes naveen ,all components inherit everything from Component class.A Label can generate MouseMotionEvent etc.
Originally posted by Nasir Khan:
Though CheckBoxMenuItem generates ItemEvent but it should generate ActionEvent as well b/c addActionListener method is
inherited from its super class MenuItem...
Originally posted by Amar Das:
I was just testing the installation of java on my machine. I wrote the following program and saved it as Hello.java. Then I compiled it using javac Hello.java. It compiles fine. But when I try to run it using java Hello I got the following error messageException in thread "main" java.lang.NoClassDefFoundError: Hello
My code sample for Hello