Short answer, no. Here are some important differences:
Java is a little trickier. You need to download the Java Software Development Kit (SDK), which includes the Java Compiler to translate your program into machine code, and the Java Virtual Machine (JVM) which then runs it.
To save time and heartache, we use repl.it for all the AP Computer Science courses in Java. It allows us to code and run Java programs on the web. This means you can easily switch between computers when you work on code, and don't have to download anything to run it.
line so that it says "Hello,
[YOUR NAME HERE]"
Then, press the Run button to execute the code.
We will go into detail on all of this later. For the time being, all you need to know is that the code that you want to run should go in the
main method of you
We use the term fork to refer to making a copy of some code so that we can make changes to it.
Imagine a fork in the road. You are about the take the code one direction, but the main code will likely go a different direction. This allows us to experiment!
Check out the Java program SecretNumber here.
This program makes a random number, ask the user to give a number, and then tells you both numbers to see if you guessed correctly. To modify it, we need to fork it.
Once you have opened the repl, click the pencil icon in the top near the name of the project. This should open a menu, with the option to fork at the bottom.
The rest of the steps of this lesson will teach you how to set up for Java coding on a single computer. This is a bit more work, but if you will always be using the same computer to do these courses, you can save some time long term.
To test whether or not Java is installed correctly, open the terminal. On Mac, this called Terminal. On Windows, I recommend installing Git Bash. On Linux you will most likely use XTerm.
Once you have opened your terminal program, type:
and press return