Henry Wong wrote:
Matthew Han wrote:shouldn't the static initializer run first to set Length to 10 and then, line 3 set it to 5?
No. Initialization of static variables, and static initializers, run in the order that they appear in source.
Henry
at runtime, there will be an exception.
Norm Radder wrote:Does not compile would describe a source file where the compiler finds syntax errors
runtime error is would be an error that happens when the compiled code is running
An exception is a type of runtime error
Liutauras Vilda wrote:Matthew, welcome to the Ranch
Could anybody help me with these concepts? I am a little confused with them.
Do you have and could provide some particular examples which confuse you?
Les Morgan wrote:Matthew,
Here is a link to The Java Really Big Index, it is a list of topics and links for Java documentation and also a list of tutorials for further reading.
Or here is a link specifically to the Oracle Tutorial on Exceptions.
Basically any method that can throw an Exception has to have that Exception caught or passed up to the caller of the present method so:
or to handle an Exception locally you need to have a try/catch block like this:
Les
Matthew Han wrote:Could anybody help me with these concepts? I am a little confused with them.
Thanks