Khalid's book said return; can exist in initializers(P149).But when I compile the following code,the compiler complains public class MQ7 { int i=0; { i=8; return; } public MQ7() { i=10; return; }
public static void main(String args[]) { MQ7 tf = new MQ7(); } } Did I miss something?
Yes u did, u cannot do this kind of operation within the body of class itself, it has to b within a method, constructor or a main body for ot to work...
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Gift giving made easy with the permaculture playing cards