In the process of learning Scala, or trying to understand a particular problem, you want to examine the source code and bytecode the Scala compiler generates from your original source code.Back to top
You can use several different approaches to see how your Scala source code is translated:
Yesterday I created a video tutorial on the Scala REPL and var & val variable types, and today I took a little time to create a new "Hello, world" Scala video tutorial. Without any further ado, here's the video:
If you're in the market for a Scala "Hello, world" tutorial, I hope you like it.
As a Scala newbie, I'm curious about how the process of converting a Scala class back to Java source code works. What I really want to see is how my Scala source code is converted to Java source code. Besides plain old curiosity, I think that understanding more about how Scala works can also be very important to my understanding of Scala (such as the apply() method, and so on).
Here's a little tutorial on how to disassemble Java class files with
One of my favorite Java subjects is code optimization and performance. Here I'd like to show you a couple of neat things you can learn with the
javap -c command. This command lets you disassemble Java bytecode.
The first thing you need to have for this exercise is a little sample Java code. So in the examples below I create two test Java classes, appropriately named Test1.java and Test2.java. Although it's not explicitly stated below, the steps I'm going to follow are these: