pretty rusty but im pretty sure i've never seen a code written like this. it is a mock question from java associate exam could someone tell me whether the 'static' in line 10 is connected to the go() method?? and mainly why is the output is x y c g ???
public class testclass {
testclass() {
System.out.print("c ");
}
{
System.out.print("y ");
}
public static void main(String[] args) {
new testclass().go();
}
void go() {
System.out.print("g ");
}
static {
System.out.print("x ");
}
}