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.
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?
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
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
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)