Browsing 7239 questions and answers with Jon Skeet
You happen to have picked countries which all have the same format. However, that's not always the case. Here's a different example: import java.util.*; import java.text.*; class Test { public static void main(String[] args) { ... more 4/19/2016 6:48:46 PM
Contrary to the other answers, I wouldn't change your code to return null if you fail to encrypt the text - I would let that failure bubble up as an exception. I wouldn't declare that your method can throw Exception either - I'd specify... more 4/19/2016 4:03:04 PM
my second task only should start where the first ends Then you should genuinely wait for it to finish. Currently, you're not doing so. You're waiting for the DoFirstThing method to return, but it will do so before it finishes awaiting... more 4/19/2016 12:00:13 PM
There are two issues here: 1) Your input is invalid. It has too many = at the end, so the Linux output includes "base64: invalid input" which you're merrily decoding as hex afterwards. 2) hexdump isn't giving you the format you really... more 4/18/2016 7:14:32 AM
Well you could just create a new ExpandoObject and use reflection to populate it with the properties from the existing object: using System; using System.Collections.Generic; using System.Dynamic; using System.Linq; using... more 4/18/2016 6:08:33 AM
The output of javac is always classfiles, and the name of the file matches the name of the class contained within it. (A source file with multiple classes in will result in multiple output files.) If you use the -d command line option,... more 4/17/2016 9:36:34 PM
Simply put: if anyone can derive from it, there can be multiple instances. So you definitely need some way of preventing arbitrary derivation. Now you can simply rely on a private constructor to prevent subclassing instead (and you need... more 4/17/2016 7:27:01 PM
As per comments, if you want to decode a byte array in a particular encoding, just use Encoding.GetString. For example: string text = Encoding.ASCII.GetString(bb, 0, k); (Note that ASCII is rarely a good choice if the text is meant to... more 4/17/2016 4:34:12 PM
You've declared a rectangular array - although I suppose "cuboid" array would be more appropriate in this case. But you have to make each "sub-array" initializer the same length. To continue the geometric metaphor, every column has to be... more 4/16/2016 6:41:42 PM
But here how can even a BaseClassA reference variable point to DerivedClassC object and it prints DerivedClassB's output ? The code calls the method which is declared by BaseClassA but overridden by DerivedClassB. The method declared... more 4/16/2016 4:54:20 PM