Question

I'm wondering how a programming language like Java can handle Variables and/or Pointers in an isolated environment like Java Virtual Machine and its own Byte-Code.

Examples in Assembly or binary equivalents are highly appreciated.

Was it helpful?

Solution

I suggest you read a little of how Java actually works.

Java doesn't have pointers, it has references which you cannot examine in pure Java. An important distinction about references in Java is that they

  • can change at any time without notice
  • don't have to be a direct address in memory. It can be encoded. e.g. to allow 32-bit references to access up to 32 GB of memory.

It has variables like any other language but you can't get a reference to them.

The byte code is a literal translation of the Java code and read it is unlikely to be more useful than reading the Java code unles syou have a deep understanding of Java. Note: the JVM compiles this to native code, so it is not the code actually run much of the time.

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