Browsing 7239 questions and answers with Jon Skeet
Your property is declared as a single int - despite it being an array in the JSON. It looks like you should be deserializing the JSON to a single BOMembint[erSelectedID, but the MemberSeletedId property should be an int[] or... more 4/7/2015 9:35:40 AM
The problem is that you're passing in the XML content itself - but DocumentBuilder.parse(String) accepts a URL to load the XML from - not the content itself. You probably want to use DocumentBuilder.parse(InputSource) instead, having... more 4/6/2015 4:59:25 PM
Currently you're declaring local variables. Those only exist while you're executing the method. It sounds like they should actually be instance variables (fields) within your class: public class Whatever { private String username; ... more 4/6/2015 11:35:00 AM
Your JSON represents an object with trn as a property within another object. So you need to represent that in your code, as well. For example: using System; using System.IO; using Newtonsoft.Json; public class Transaction { ... more 4/5/2015 4:56:38 PM
The simplest way would just be to order by date (e.g. using a Comparator<Module>) and then just iterate: Map<String, DateTime> map = new HashMap<>(); for (Module module : sortedList) { map.put(module.getName(),... more 4/5/2015 7:41:54 AM
Generic variance in C# is very different to generic variance in .NET. You sort of want something like this: public interface IStorage<out T> : IEnumerable<T> { // This won't compile - the constraint is on the wrong... more 4/4/2015 1:21:00 PM
But as far as I know the number classes are all inherited from the abstract Number class. Yes, but that's completely irrelevant when it comes to operators. You can't add operators overloads in Java at all, regardless of whether your... more 4/4/2015 11:46:16 AM
I'd prefer a built-in named pattern over supplying all formatting to ToString. If you mean you're expecting a "standard" pattern so to speak, there isn't one. However, it's easy enough to write a custom pattern for this - giving you... more 4/4/2015 9:57:07 AM
Shouldn't the exception be caught before in the catch block and returned ? It is being caught, and that return statement is being executed... but then the return value is being effectively replaced by the return statement in the... more 4/3/2015 3:52:55 PM
Just output each value in turn. For example: // TODO: Rename PrimeFactor to primeFactors to follow Java naming conventions for (int value : PrimeFactor) { System.out.print(value); System.out.print(" "); // Or whatever separator... more 4/3/2015 12:58:53 AM