In contrast to the non-wildcard versions, parameterized types that include a bounded wildcard are
related in the way you might have expected. For example, List<?extends Integer> is a subtype
of List<?extends Number>, which is itself a subtype of List<? >. Similarly, List<?super
Number> is a subtype of List<?super Integer>.
Originally posted by Angela lewis:
K&B page 82
Just remember that default members are visible only to the subclasses that are in the same package as the superclass.
Does that mean class that are in the same package but not subclasses
cannot access default memebers.
I tried the following code and it works
Am i interpreting it incorrectly?
Originally posted by Sridhar Srinivasan:
Hi!
When I compile the following code I get the value as 1
public static void main(String[ ] args)
{
int k=0;
k += ++k;
System.out.println(k);
}
As per my understanding, bec's of operator precedence k becpomes 1 first and now k holds the value of 1 and then when we say k+=1 which is k=k+1(1+1) is 2.Why is it giving 1?Can anybody please explain.Thanks