You searched for exceptions
. We found 168
results in 0.053 seconds.
This is the problem: public static int Jobs = valueN(), inp = 4; ... public static int valueN(){ ... int[] MN = new int [inp]; ... n=MN[0]; } When you run valueN(), inp is still 0. The initialization which will set inp... more
If the array remembers what type of data it contains, it means that it KNEW the type of data it contains. At execution time, yes... just like at execution time, the type of an object is known: Object x = "foo"; // The compiler won't... more
You normally want to perform the same clean-up action whether an exception is thrown or not. Doing that just with catch blocks is painful - especially if you want to make sure that you only call close() once, even if that throws. You'd end... more
The problem is more simply demonstrated like this: import java.io.*; class Test { private static Reader reader = new FileReader("foo.txt"); } The problem is that the static initializer for your class can throw an exception. That's... more
My question is: what is async really doing when there isn't an await? In terms of observable behaviour: The code will still run synchronously, as the warning says The result (including any exception thrown) will be wrapped up in a... more
Clearly, SerializeObject returns string then why json is dynamic type instead of string. Almost every operation involving a dynamic value is considered to be dynamic in turn. This includes method calls and most operators. The only... more
The exception message shows that you've used Blog and Post as classes nested within Program, whereas the instructions state: Below the Program class definition in Program.cs add the following two classes. Personally I'd put them into... more
Why does the compiled code on assembly 2 change based on a method signature that (at least I think) should be transparent? No, it shouldn't. When you don't specify an argument to correspond with an optional parameter, the default... more
my code snippet has something different in that it will never cause an "unassigned" error Well it clearly does cause that error, which is why you asked the question, no? Even though you know that any time the exception is thrown,... more
Well unless you really need the catch block, you don't need to introduce try/catch/finally. You can just add a throw statement at the end of your initial method. Along the way, I'd start using FirstOrDefault(), follow normal C# naming... more