asList() returns a wrapper object for the array which uses the array internally. In contrast, toArray() always creates a new array.Originally posted by Lucky J Verma:
I cant understand why aslist() shows modificatinos ,wht toArray() cannot
There is no mystery about the exception. Just follow the explanation from Al Mamun and add the following:Originally posted by Mohammed shareef:
if we increase length of Anonymous array to 5 it is giving ArrayIndexOutOfBound Exception .Let's wait &see who willl solve this mystery.
Correct.Originally posted by Praveen Seluka:
Think e is exponential
D or d specifies that this literal is a double value. In contrast, use f or F for float values.what is d?
No. The compiler only looks at the type of the reference variable. The subclass is of no interest at this point.Originally posted by sandeep atluri:
so it checks if the method is present in both the classes. which is true. and it comes to the conclusion that there is an overloaded version in the subclass.
Since the compiler makes a copy of the reference variable before the finally block is executed.Originally posted by Gaurav Bhatia:
I am setting the String reference to point to a new value. Then why is it returning the old value.
For me, the following produces the race condition.With synchronisation I get the expected result of 200000. Without I get something between 150000 and 180000.Originally posted by Burkhard Hassel:
If anyone has a running demo that shows that any i++ cause a race condition, I would be curios to see it.
Have a look at 15.15.1 Prefix Increment Operator ++ in the Java Language SpecificationOriginally posted by dhwani mathur:
Does ++b promote byte b to an int?
In this sample there is no object eligible for garbage collection. The code uses only string literals, and the objects for those are created at class loading time.Originally posted by Sachin Kapoor:
String name;
String newName = "Nick";
newName = "Jason";
name = "Frieda";
String newestName = name;
name = null;
No. In this sample there is only one object eligible for garbage collection. For details have a look here.Originally posted by Ansar Shah:
Answer:
3 C is correct. Only one CardBoard object (c1) is eligible, but it has an associated Short
wrapper object that is also eligible.
A, B, D, E, and F are incorrect based on the above. (Objective 7.4)
If you read the text, you will see, that I know that this will not work. It is only for demonstration purposes.Originally posted by Srinivasan thoyyeti:
Do you think wait,notify can be called out-side synchronized context