class OrdenEjecucionCompleto
{
static int num1 = 5, num2 = 23;
int num3 = 14, num4 = 9;
static{
new OrdenEjecucionCompleto();
System.
out.
print("Bloque Estatico \n num1 + num2 = "); System.
out.
println( num1
+ num2
); }
{
System.
out.
print("Bloque de Instancia \n num1 + num3 = "); System.
out.
println( num1
+ num3
); }
{
System.
out.
print("Metodo Main \n num2 - num1 = "); System.
out.
println( num2
- num1
); }
OrdenEjecucionCompleto(){
System.
out.
print("Constructor \n num4 + num3 = "); System.
out.
println( num4
+ num3
); }
}
Y2xhc3MgT3JkZW5FamVjdWNpb25Db21wbGV0bwp7CgkKCXN0YXRpYyBpbnQgbnVtMSA9IDUsIG51bTIgPSAyMzsKCWludCBudW0zID0gMTQsIG51bTQgPSA5OwoJCglzdGF0aWN7CgkJbmV3IE9yZGVuRWplY3VjaW9uQ29tcGxldG8oKTsKCQlTeXN0ZW0ub3V0LnByaW50KCJCbG9xdWUgRXN0YXRpY28gXG4gbnVtMSArIG51bTIgPSAiKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oIG51bTEgKyBudW0yICk7Cgl9CgkKCXsKCQlTeXN0ZW0ub3V0LnByaW50KCJCbG9xdWUgZGUgSW5zdGFuY2lhIFxuIG51bTEgKyBudW0zID0gIik7CgkJU3lzdGVtLm91dC5wcmludGxuKCBudW0xICsgbnVtMyApOwoJfQoJCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTeXN0ZW0ub3V0LnByaW50KCJNZXRvZG8gTWFpbiBcbiBudW0yIC0gbnVtMSA9ICIpOwoJCVN5c3RlbS5vdXQucHJpbnRsbiggbnVtMiAtIG51bTEgKTsKCX0KCQoJT3JkZW5FamVjdWNpb25Db21wbGV0bygpewoJCVN5c3RlbS5vdXQucHJpbnQoIkNvbnN0cnVjdG9yIFxuIG51bTQgKyBudW0zID0gIik7CgkJU3lzdGVtLm91dC5wcmludGxuKCBudW00ICsgbnVtMyApOwoJfQp9