Skip to content

Instantly share code, notes, and snippets.

@arturaz
Created November 5, 2012 12:34
Show Gist options
  • Save arturaz/4016967 to your computer and use it in GitHub Desktop.
Save arturaz/4016967 to your computer and use it in GitHub Desktop.
$ cat aa.scala && javap -c Foo.class Bar.class
class Foo { val aa = 3 }
class Bar { def aa = 3 }
Compiled from "aa.scala"
public class Foo implements scala.ScalaObject {
public int aa();
Code:
0: aload_0
1: getfield #11 // Field aa:I
4: ireturn
public Foo();
Code:
0: aload_0
1: invokespecial #17 // Method java/lang/Object."<init>":()V
4: aload_0
5: iconst_3
6: putfield #11 // Field aa:I
9: return
}
Compiled from "aa.scala"
public class Bar implements scala.ScalaObject {
public int aa();
Code:
0: iconst_3
1: ireturn
public Bar();
Code:
0: aload_0
1: invokespecial #12 // Method java/lang/Object."<init>":()V
4: return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment