Browsing 7239 questions and answers with Jon Skeet
happy and social should not change their order. Is their a way? Well, that's just a JSON object. It's rare (IME) that the order should matter - and that doesn't look like it's what actually causes the failure you're seeing. I would... more 4/23/2015 4:11:07 PM
You're calling writeObject multiple times on the same ObjectOutputStream - but in the reading code, you're only calling readObject once. You'll need to loop in the reading code, e.g. while (true) { String message = (String)... more 4/23/2015 11:34:41 AM
What am I doing wrong here? Not building CarRental, or not telling the compiler where to find the class if you have already compiled it. The IDE is probably assuming you want to build everything, so that's fine. We don't know how... more 4/23/2015 10:46:59 AM
When the user enters "-1" its should stop the program and then print out the average of those marks. Well if the user enters -1, you'll never get out of the nested loop that validates the input. If you want to allow -1, you should... more 4/23/2015 9:02:03 AM
Now If person A and person B use the same function who are sitting in two different time zones, will they get the same result? Yes, they will - assuming their clocks are both "correct" of course. The java.util.Date class is basically... more 4/23/2015 7:18:19 AM
The method you're trying to use is a member of java.nio.file.Files - but that class (and indeed that package) doesn't exist on Android. Even if the Java 7 version existed, you're trying to use a method introduced in Java 8. The Files class... more 4/23/2015 6:02:11 AM
Yes. Just call it with an explicit type argument: foo.<Integer>get("something") I'm not terribly fond of how type arguments are expressed in Java, but they're perfectly doable. See the Java Generics Tutorial for another example. more 4/22/2015 9:21:56 PM
This is the problem: for (int i = 0 ; i >= store.size(); i++) Unless store is empty (in which case you'll get an exception), i >= store.size() will immediately be false. You meant: for (int i = 0; i < store.size(); i++) Or... more 4/22/2015 9:05:46 PM
Consider what your HTML will look like. First version: onclick="F1(abc)" Second version: onclick="F1(5)" Clearly the second version is passing the value 5. The first version is passing the value of abc - whatever that is, within the... more 4/22/2015 5:38:17 PM
I want to override the EqualityComparer for one of my LINQ to SQL classes I really don't think you do. I think you want to override the Equals method, and probably implement IEquatable<T>. EqualityComparer is meant for an object... more 4/22/2015 5:31:54 PM