Browsing 7239 questions and answers with Jon Skeet
You can't. The garbage collector is part of the JVM, and can't just be moved around. If you have the source code for both you could consider trying to patch the collector back in - but it would probably be a very large task, and I'd be... more 6/9/2014 5:48:18 AM
So as per the class file method1 and method2 take same array argument. Yes, except there's extra metadata within the class file to indicate that the parameter for method2 is a varargs parameter. It's really just an extra bit of data... more 6/8/2014 2:35:11 PM
A char in Java is a UTF-16 code unit. It's not necessarily a complete Unicode character, but it's effectively an unsigned 16-bit integer. When you write text to a file (or in some other way convert it into a sequence of bytes), then the... more 6/7/2014 8:10:47 AM
I discovered what i think is a bug whilst using netbeans. Well, it may be a bug in your code. It's not a bug in Java or in Netbeans. It's just demonstrating the fact that arrays are reference types in Java, and the way that objects... more 6/6/2014 4:52:20 PM
This is the problem: private static int height; private static int width; Those fields are static, meaning they're set for the type itself rather than being specific to any instance of the type. I strongly suspect they should just be... more 6/6/2014 2:20:28 PM
The problem is that 56623 is U+DD2F - which is a high surrogate UTF-16 code unit. It's invalid on its own - it's only valid as part of a surrogate pair used to encode code points which aren't in the Basic Multilingual Plane. It should be... more 6/6/2014 1:27:26 PM
I suspect the problem is simply that on deserialization, nothing is populating the floatone and floattwo fields. You're trying to populate the data within objects that don't exist. This: public void readFields(DataInput in) throws... more 6/6/2014 1:04:01 PM
From the Random.nextInt(int) documentation: Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive) ... Parameters: bound - the upper bound (exclusive). Must be... more 6/6/2014 12:49:43 PM
From the documentation: Stubbing voids requires different approach from when(Object) because the compiler does not like void methods inside brackets... doThrow(Throwable) replaces the stubVoid(Object) method for stubbing voids.... more 6/6/2014 12:36:38 PM
No, what you've shown isn't overriding at all - it's overloading. (The use of the @Override annotation is obviously to do with overriding, but it's incorrect used here - there's no superclass method to override.) Overriding is when a... more 6/6/2014 10:21:12 AM