Create 2 otf classes and use them in a main (same for another method)
PHP Code:
public class test {
public static void main(String[] input){
////// on-the-fly classes
class ExampleObject {
public void set_data(int in_data){
data=in_data;
}
public int get_data(int in_data){
return data;
}
private int data = 0;
}
class ModifyExampleObject{
ModifyExampleObject(ExampleObject obj, int value){
obj.set_data(value);
}
}
////// END on-the-fly classes
/* Normal expression */ final int samplevalue = 10;
/* Normal expression */ new ModifyExampleObject(new ExampleObject(),samplevalue);
}
}
Comment