• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

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.
0
jedistar
Asked:
jedistar
1 Solution
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now