Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ben Os
20,008 PointsWhy is there that much machine code compiled from my Java source code?
I compiled the following source code in Introductions.java:
import java.io.*;
public class Introductions {
public static void main( String[] args ) {
Console console = System.console();
console.printf("hello");
}
}
/*
public class name as file name (case sensitive).
*/
I got, in Introductions.class:
ֺ÷¾ 4
<init> ()V Code LineNumberTable main ([Ljava/lang/String;)V
SourceFile Introductions.java hello java/lang/Object
Introductions java/lang/System console ()Ljava/io/Console; java/io/Console printf 8(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/Console; ! *· ±
0 ¸ L+½ ¶ W±
Why is there that much machine code compiled from my Java source code? I mean, it seems much more than what I originally wrote.
Moreover, why is there English mixed with that machine code?
Tomas Svojanovsky
26,680 PointsTomas Svojanovsky
26,680 PointsHello, I don't think it is machine code. Java compiled code should be bytecode - https://www.beyondjava.net/blog/java-programmers-guide-java-byte-code/
Probably it is from the workspace and it can't display the format. I am not java expert, just consideration.