Browsing 7239 questions and answers with Jon Skeet
Your semua method creates a new instance of processor which it then reads from: public void semua() { processor a = new processor(); System.out.println(a.getpro()); } That's entirely unrelated to the processor instance you've... more 11/29/2014 10:09:07 AM
Let's take arrays out of the equation - an array is just a collection of variables, really. Let's consider a single variable. Suppose we had a method like this: public boolean isEmpty(char c) What would that do? The value of c cannot be... more 11/29/2014 9:41:41 AM
The simplest way of creating an Action<d2> from an Action<d1> is via another lambda expression: Action<d1> original = ...; Action<d2> converted = x => original(new d1(x)); It would be best to avoid having the... more 11/28/2014 5:31:55 PM
The system clocks are set at different times, that's all - at least one of them is inaccurate. Presumably one or both of them isn't synchronized. Ideally, you should synchronize against something like NTP. This isn't something you would... more 11/28/2014 5:26:47 PM
The problem is that you're creating an array, but that array contains empty references to start with - you're never creating any instances of Word. You want something like: Word[] Wörter = new Word[5]; Wörter[0] = new... more 11/28/2014 4:18:11 PM
It's safe because getMap returns the map for the given (i.e. current) thread. No other thread is going to be messing with that. So it's really down to the implementation of getMap to make sure that's is okay for any thread - and as far as... more 11/28/2014 12:06:35 PM
Well any time you call ElementAt, if it's just a sequence (i.e. not an IList<T>) it will have to iterate all the way through the sequence as far as the given element number - there's no other way of it getting to the value. It... more 11/28/2014 11:56:51 AM
You basically need to flatten the results so you've got team/number pairs and then you can group by the number. So for example: // IEnumerable<IGrouping<string, Team>> var grouped = from team in teams from person... more 11/28/2014 10:41:49 AM
So what are GC roots for the classes? Classloaders, effectively - via other GC roots. If there is nothing which can reach a classloader - which means nothing can reach any instances of classes created by that classloader - then both... more 11/28/2014 10:38:03 AM
Type argument inference always works on method arguments - including the first argument to an extension method like Select. So your second call is effectively: Enumerable.Select(new List<int>(), Id()) Select will be able to use... more 11/28/2014 10:35:45 AM