AP Computer Science
Introduction to Java
Credit: Slides are modified with permission from Barry Wittman at Elizabethtown College
This work is licensed under an Attribution-NonCommercial-ShareAlike 3.0 Unported License
First Program
Hello World
public class Hello
{
}
Hello World
public class Hello
{
public static void main(String[] args)
{
}
}
Hello World
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello world!");
}
}
Hello World
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello world!");
}
}
Write, compile, and run the Hello World program in both
jGRASP and repl.it.
jGRASP
Create Your Own in jGRASP
repl.it
What is repl.it?
repl.it is a simple yet powerful online Integrated Development Envorinment (IDE), Editor, Compiler, Interpreter, and REPL. Code, compile, run, and host in 50+ programming languages.
Sign Up
Beware !!!
If you use your AISD e-mail address, be sure to save your password, as repl.it will be unable to email you a password reset.
Use any user name you like, but first and last name of registration must follow a specific pattern shown later in this presentation.
Create a new repl for your program
Default repl (i.e. program) name - change it here now or on the repl page later.
main() method must be in Main class in Main.java
your program
program output
run your program
public class Main
Join these repl.it classes
https://repl.it/classroom/invite/9YBbNS5
https://repl.it/classroom/invite/svmrzxO
Go into the AP CS repl.it class and select the
01. Intro01a:Hello World! assignment
enter/finish program here
program output shown here
instructions from teacher
go back
program output shown here
run your program
run the teacher's tests
Write the program, run & test it
Programming Errors
forgot the ;
misspelled println
run your program
run your program
When all the tests pass & you are ready to turn the assignment in click on submit
Sometimes the teacher will provide a model solution