zarina mohammad

Ranch Hand
+ Follow
since Jun 26, 2002
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 zarina mohammad


For me both the lines 1 and 2 result in compiler error(JDK 1.4)
line 1 does not require the instance of the enclosing class to call the method of the static inner class.it works fine without that.

same is with line 2
thanks thomas and dan that was certainly a detailed explanation.
check out this link from sun's website
where can i find more detailed explanation of answers of 12 and 13 in Exam A

Given an application that may be implemented using either an ArrayList or a Vector which of the two is preferred?
Given an application that may be implemented using either an HashMap or a Hashtable which of the two is preferred?


thanks
i tried both Exam A and B. i found them simple and good.
Its true that if an exception is not
caught, the finally block will run and the
rest of the method is skipped. you can prove it with a simple example.

//after exception line is not executed because of the arthmetic exception thrown at line 5.
u mean converting a hexadecimal number to decimal number?
its as follows
to convert a hexadecimal like 0x1234 to binary
1x16^3 + 2x16^2 + 3x16^1 + 4x16^0=4660

In the post increment i++ the value of i that is used in the calculation is the original value ,increment or decrement only occurs only after the expression is calculated.
hence the output will be 1

[ August 22, 2002: Message edited by: zarina mohammad ]
When it comes to interface a class can be cast to interface implicitly if the class implements the interface.
But explicit conversion is needed to cast an interface to class implementing the interface(which is legal even at runtime) or to a class not implementing the interface(illegal at runtime)
this example might help you understand better
Its Arthmetic Exception ...not compiler error.
(tried on java 1.4)
what the text says is you need to have a try-catch block in the finally block.
the code can be changed as follows:

[ August 21, 2002: Message edited by: zarina mohammad ]
start() method does not take any parameters.
i found this explanation in one of the threads here ...
Proceed as follows to get the decimal equivalent of a -ve number:
say -8
1. Invert all the bits.
--> so 1111 1000 becomes 0000 0111.
2. Strip all the leading zeros and convert to decimal.
--> so 0000 0111 becomes 111 which is equivalent to 7.
3. Add 1 to the result and then put the negative sign.
--> 7+1 = 8 and finally it becomes -8.
so 1111 1000 = -8.
To convert a -ve decimal to a binary just do the reverse.
Taking the example of -8
1.Strip it off the -ve sign and subtract 1.
-->so -8 becomes 8 and then 7.
2. Convert the decimal to binary
-->7 is 0000 0111 in binary.
3.Invert the bits
-->Result is 1111 1000. (same as the start of this message)

hope this helps
zarina