Browsing 7239 questions and answers with Jon Skeet
Why doesn't Eclipse open the declaration of such enum methods? Because they're not declared in source code at all. They're automatically supplied by the compiler - where would you expect to be taken? Ctrl-clicking on MyEnum (rather... more 4/25/2014 1:15:48 PM
It may not be appropriate. For example, consider: class Other : Bar {} ... IDo<Other> do = new DoImpl<Other>(); Foo<Other> foo = new Foo<Other>(); foo.Add2(do); With your current code, that would be calling... more 4/25/2014 11:47:26 AM
You use Class.getModifiers(), ideally using the Modifier class to interpret the return value in a readable way: if (Modifier.isFinal(clz.getModifiers()) more 4/25/2014 10:51:15 AM
Now we have a bit more information It sounds like you don't want to parse a numeric string at all, which is the obvious interpretation of your original question. If you want to map a string to a number, you'll need some sort of... more 4/25/2014 9:19:46 AM
The name of the class containing parseDouble is Double, not double. They are not synonyms. double is the name of the primitive type, and primitives do not have methods. So you need: retail_price = Double.parseDouble(input1) *... more 4/25/2014 8:52:22 AM
You've created an image with a height and width of 1. Coordinates start at 0, therefore the only valid first two arguments two SetPixel are 0: bm.SetPixel(0, 0, Color.AliceBlue); The only confusing thing is how this could ever have... more 4/24/2014 4:46:54 PM
affichertable is an instance method in personne. You're trying to call it as if it's a static method in popo. You should be calling p1.affirchertable(...) or p2.affichertable(...) at a guess. Alternatively, if the affirchertable method... more 4/24/2014 4:39:57 PM
If you want a dot rather than a comma, you should specify a Locale which uses dot as the decimal separator, e.g. DecimalFormat df = new DecimalFormat("#.00", ... more 4/24/2014 1:28:24 PM
The problem is that in the first case, the expression i is of type short, whereas the expression i - 1 is of type int. Those values are being boxed to Short and Integer respectively - the Integer isn't in the set, so can't be removed. You... more 4/24/2014 11:02:27 AM
You've got a variable of type Object, and you're calling Arrays.asList. That means you've effectively called: List<Object> values = Arrays.asList(new Object[] {valueArr}); So you're creating a list of a single element, where that... more 4/24/2014 9:32:26 AM