Question

I'm just curious as to how a string Java Assembly code is converted to bytecode? Say for example the java assembly code said this:

print 'Hello World'

I know this isn't what Java Assembly actually looks like, it's just to help get my point across. How does Java convert the above code into byte code? For example does the assembler remove the single quotes to leave this:

print Hello World

And then take the print as the instruction and everything else as the argument when converting to byte code or does it preserve the single quotes? Sorry if my question is hard to understand, if my question is hard to understand I'd be happy to edit it.

Was it helpful?

Solution

There are no bytecodes, per se, involved in the storage of literal constants. The .class file just has a table of these constants, and when the class is loaded they're placed into memory, much like initializing static variables.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top