User Tools

Site Tools


j1-1_strings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
j1-1_strings [2024/12/05 05:19] appledogj1-1_strings [2024/12/05 06:40] (current) appledog
Line 54: Line 54:
 === Main.java === Main.java
 <Code:Java|Main.java> <Code:Java|Main.java>
 +import java.util.Scanner;
 +
 public class Main { public class Main {
     public static void main(String[] args) {     public static void main(String[] args) {
Line 93: Line 95:
 Teacher may discuss the answers here. Teacher may discuss the answers here.
  
-== The Code+== Don't Read This Section
 Here's an explanation of what each line of the program does. We will look at it like a computer looks at it. First, here's the basic starter program: Here's an explanation of what each line of the program does. We will look at it like a computer looks at it. First, here's the basic starter program:
  
Line 131: Line 133:
 This means the function doesn't return anything. Actually this surprises me, since it seems a main function should return an error code. But no, in Java there is no return. Sounds ominous. Try changing the void to an int and returning a 5. It doesn't work. This means the function doesn't return anything. Actually this surprises me, since it seems a main function should return an error code. But no, in Java there is no return. Sounds ominous. Try changing the void to an int and returning a 5. It doesn't work.
  
-== The Code+== The Code (Read This Part!)
 === System.out.println("Hello!") === System.out.println("Hello!")
 This kind of code just prints a message out. This kind of code just prints a message out.
j1-1_strings.1733375947.txt.gz · Last modified: 2024/12/05 05:19 by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki