Java Byte Code Compiler & New objects

1. I would like to know how does the Java Byte Code Compiler work,
whats the difference between "JIT just-in-time compiler" & intepreted methods?
How does Hotspot VM compiler come in?

2. Whats the difference between using new() to create new objects
and Class.newInstance();

thanks.
jedistarAsked:
Who is Participating?
 
TimYatesCommented:
1) Nice bytecode explanation:

http://www-128.ibm.com/developerworks/ibm/library/it-haggar_bytecode/

Nice JIT vs Interpreted explanation:

http://en.wikipedia.org/wiki/Just-in-time_compilation

Hotspot was the name for the JIT JVM.

2) Class.newInstance is using reflection

http://java.sun.com/docs/books/tutorial/reflect/index.html

new Object() is the normal way of doing it, but you have to know what class of object you're going to be creating beforehand...

Tim
0
 
WebstormCommented:
>> 2. Whats the difference between using new() to create new objects and Class.newInstance();
new <class>()  is faster than using reflection Class.newInstance()
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.