Browsing 7239 questions and answers with Jon Skeet
You don't inherit constructors at all. You declare whichever constructors you want, and make sure that each one chains appropriately, either to a base class constructor, or to another constructor in the same class. So for example, you... more 8/1/2014 6:40:29 PM
Well, the output is correct in that it's what I'd expect for midnight UTC when you're running on a system in IST. Date.toString() always uses your system local time zone - because it doesn't have any other information. A Calendar knows its... more 8/1/2014 3:13:56 PM
The class has to have at least one constructor, because all Java classes have constructors. Additionally, subclasses will have to chain to it - so it's got to be at least protected accessibility. The constructor doesn't need to do... more 8/1/2014 1:56:30 PM
It may or may not be the whole problem, but this is definitely a problem: byte[] buffer = stream.GetBuffer(); That's quite possibly returning more data than you want - because it's not limiting itself to the length of the stream.... more 7/31/2014 9:30:07 PM
You need to escape the backslashes: String trimmed = files[i].toString().replace("C:\\FREQ\\", ""); Backslashes within Java text literals (String or char) are used for escape sequences such as \t (tab), \n (line feed) etc. To get an... more 7/31/2014 6:51:17 PM
You can do this - but then you're really being very specific in your implementation, without being specific in the type system. Why not just use EventHandler<TEventArgs>? public event EventHandler<MyEventArgs>... more 7/31/2014 2:27:29 PM
This can be written pretty easily: var result = items.Where(item => item.SomeMembers.Count(secondList.Contains) * 2 >= item.SomeMembers.Length); Or possibly (I can never guess whether... more 7/31/2014 2:03:16 PM
where is the initial index of the pointer to the list should it not be the first item of the list No. It is before the first item of the list. You only get to the first item when you call next() for the first time. In fact, it's... more 7/31/2014 1:58:54 PM
You'll need to have a T value in order to call the delegate: public IGridWithOptions<T> CursorPointerWhen(Func<T, bool> propertySpecifier) { T input = GetInputFromSomewhere(); bool r = propertySpecifier(input); ... more 7/31/2014 1:52:28 PM
Of course, they all implementing the SetSomething() method Then you should tell the compiler that: Create an interface with the SetSomething() method Make all the relevant types implement the interface Constrain T to implement that... more 7/31/2014 1:49:43 PM