Does anyone really code like this? Anyone out here figure out what does this code do?
package com.twisters;Got an answer? Why don’t you leave it here.
public class StaticThis {
public static void main(String[] args) {
new StaticThis().print();
}
public static void printStatement(){
System.out.println("Static Method Print Statement called.");
}
public void print() {
this.printStatement();
}
}
Perhaps the goggles do something, since I don't see a puzzle here. (It *might* be an time worn puzzle if you had used a null reference to call the static).
ReplyDeleteHere is a old toughy of mine (at least that's a real puzzle!): http://code-o-matic.blogspot.com/2009/02/crazy-java-puzzler.html