This code is from the SCJP study guide with a slight modification. The following code compiles successfully but there is NO output. I was wondering why the statement "Inside getY()" is not generated. Is it because everything inside the local method getY() is erased once out of the method? Still feels like the statement should be output.... Would appreciate any answers.
Welcome to the Ranch
Please note Winston’s point about indentation. Study guides are often incorrectly indented to confuse you about where a bit of code is. Sort out the indentation and you can easily see whether that code is in the method or not.