Eduardo Ucha

+ Follow
since Mar 27, 2013
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eduardo Ucha

Thanks so much, it is just the answer that I needed. I understand this situations now better.
1 year ago
I have a doubt because I think that  the precedenceof  x++ is higger of +=. Look at this

It is suposed that += is sustituted by x=x +...

I don't understand why x=1 in the first x in the sum because x++ is executed before because of its precedence, but it isn't. The x++ and ++x take in account the value of x at the moment of the increment.

At the end the value of x is 3 but is overwritten with the value of 8

Well I dont understand why the last x is 2 and the first is 1. if I take in account the precedence the value of the first x at the moment of the sum it would be 3 because the increments of the value in the others operands has been executed but it's not.
1 year ago

I have chosen the NoClassDefFoundError, I used the exercise that I had to do a personal exception to do this.
I have a and a and I compile it.


Before I run the program I do a dir (I am running in windows), and I get:

27/03/2013 09:08 <DIR> .
27/03/2013 09:08 <DIR> ..
27/03/2013 09:08 704 MainClass.class
27/03/2013 09:05 391
27/03/2013 09:08 372 MiException.class
27/03/2013 08:30 255
4 archivos 1.722 bytes
2 dirs 183.944.970.240 bytes libres

I am going to delete the MiException.class file.

del MiException.class

and then i run the program.

java MainClass

Then i get my exception

Exception in thread "main" java.lang.NoClassDefFoundError: MainClass (wrong name
: com/ocaj/exam/tutorial/MainClass)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at Source)
at Source)
at$100(Unknown Source)
at$ Source)
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Thanks for the book.