You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* VS Code [https://code.visualstudio.com/download](https://code.visualstudio.com/download)
37
+
* Dev Container Extension [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
37
38
38
-
## Getting Started
39
+
## Workshop Structure
40
+
41
+
* Setup
42
+
* Variables and Data Types
43
+
* Operators
44
+
* Input and Output
45
+
* Conditional Statements
46
+
* For Loops
47
+
* Arrays
48
+
* Functions
49
+
* Practical Project Demo
50
+
51
+
## Setup
39
52
40
53
To get started, download the workshop materials by cloning the repository: (this can also be done from inside vscode)
41
54
@@ -74,3 +87,133 @@ Once you've cloned the repository, and it's open in VS Code you should get a pop
74
87
75
88

76
89
90
+
This will start the development container and install all the necessary dependencies for the workshop including Java.
91
+
92
+
This may take a few minutes so have a chat with your fellow attendees while you wait.
93
+
94
+
When it's done you should see a terminal window with the Java version displayed.
There are several different data types in Java, including `int`, `double`, `boolean`, and `String`. Each data type is used to store different types of values.
110
+
111
+
Typically you declare a variable by specifying the data type followed by the variable name. For example, to declare an integer variable called `age`, you would write `int age;`.
Operators are used to perform operations on variables and values. Java has several different types of operators, including arithmetic, comparison, and logical operators. (e.g. `+`, `-`, `*`, `/`, `==`, `!=`, `&&`, `||`)
When building a simple Java program, you may want to take input from the user and display output to the user. This can be done using the `Scanner` class for input and the `System.out.println()` method for output. (similar to `console.log` in JavaScript)
Conditional statements are used to perform different actions based on different conditions. In Java, you can use `if`, `else if`, and `else` statements to control the flow of your program.
An array is a collection of variables of the same type. You can access the elements of an array using an index. The index starts at 0, so the first element of an array is at index 0, the second element is at index 1, and so on.
If you want your program to repeat a block of code multiple times, you can use loops. Java has several different types of loops, including `while` loops and `for` loops which we'll cover below.
152
+
153
+
### While Loop
154
+
155
+
This is a basic example of a `while` loop. The loop will continue to run as long as the condition inside the parentheses is `true`. (which is always in this case)
Instead of using a constant condition, you can use a variable to control the loop. In this example, the loop will continue to run as long as the value of `i` is less than 5.
A `for` loop is used when you know how many times you want to repeat a block of code. The loop has three parts: the initialization, the condition, and the increment.
172
+
173
+
Each of these parts is separated by a semicolon. The initialization is executed once before the loop starts, the condition is checked before each iteration of the loop, and the increment is executed after each iteration of the loop.
A function is a block of code that performs a specific task. You can define a function to take input parameters and return a value. In Java, you define a function using the `public static` keywords followed by the return type, the function name, and the parameters.
Now that you've learned the basics of Java programming, it's time to put your skills to the test with a practical project. In this demo, we'll build a simple number guessing game.
200
+
201
+
If you're ready, open the `GuessNumber.java` file and follow the instructions in the comments to complete the project.
Another fun project you can try is building a simple rock-paper-scissors game. Open the `RockPaperScissors.java` file and follow the instructions in the comments to complete the project.
Congratulations on completing the 2025 Java Workshop! We hope you've learned a lot and had fun along the way. If you have any questions or feedback, feel free to reach out to us on Discord or GitHub.
0 commit comments