Browsing 7239 questions and answers with Jon Skeet
Well this is always going to fail: public class A { private B someB; private C someC = someB.getSomeC(); } You're trying to call getSomeC() on a value which will always be null... that will always thrown NullPointerException. You... more 12/12/2013 10:27:23 AM
Some reference found on internet suggests that we cannot have call by reference in Java. Is it completely true Yes. Java is pass-by-value, always. The values which are passed are either references or primitive values. (Objects are... more 12/12/2013 10:20:35 AM
This is the problem: foreach (XNode field in xdoc.Descendants("table").Nodes()) That's looking for all nodes under all table elements. You don't want that. You've already got the table you're looking at as an XElement - so use that. It... more 12/12/2013 8:04:32 AM
You need to specify the namespace when you look for the element: XNamespace atom = "http://www.w3.org/2005/Atom"; ... rss.Link1 = rssItem.Element(atom + "link").Attribute("href").Value; LINQ to XML makes namespace handling much simpler... more 12/12/2013 7:21:00 AM
You need to read the wire format documentation, basically. The size of floating point fields will always be fixed, but for integers there are options: fixed32 and fixed64 will be fixed (as the name suggests), but int32, int64, sint32,... more 12/12/2013 6:53:33 AM
Well first ChildExtending needs to be initialized (as a type). That will produce the output of parent static executed child static block executed as per section 12.4.2 of the JLS. Only once the type is initialized can the constructor... more 12/12/2013 6:50:33 AM
You should just be able to install the Help Viewer (if you haven't already got it). In Visual Studio, under the "Help" menu, set the "Help Preference" to "Launch in Help Viewer" - it should download the relevant content for you if you... more 12/11/2013 9:56:05 PM
It sounds like you just need: return Counties.SelectMany(county => county.Cities) // IEnumerable<City> .Select(city => city.CityName) // IEnumerable<string> .ToList(); ... more 12/11/2013 8:57:52 PM
I am working with NetBeans. I saved the .dat file in the default package folder where the main file is located. And it cannot find the .dat file. Presumably that folder isn't the same as the working directory when you launch it. Use... more 12/11/2013 8:33:35 PM
I was curious to know a foreach loop can utilize yielded function's results before all the yields have been completed. Absolutely, that's part of the point. The iterator block executes lazily. The method effectively "pauses" when it... more 12/11/2013 6:29:21 PM