문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top