All 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9

All Topics:


1.1: "Hello, World!" and Syntax
(All Topics)

If you ask someone what their first program was, odds are good they will tell you "Hello, World!"

"Hello, World!" is a very simple program that outputs "Hello, World!" to the console. The program consists of a class (can be named whatever, in our example it is named Main) that contains a main method (sometimes called the driver) and within it a single print statement, as follows:

public class Main
{
  public static void main(String[] args)
  {
    System.out.println("Hello, World!");
  }
}

*Note Java is case-sensitive, so system.out.println(); would result in an error

Notice the semicolon? Java is compiled, so it requires a semicolon after each instruction in order for the compiler to identify where an instruction ends. The compiler is a program that compiles source code (high level) down to bytecode (middle level), which is then interpreted and executed by the Java Virtual Machine (JVM).

Activity 1) Fill in the code

Main
{
  public static void
(String[] args)
  {
    
.out.println("LearnMade rocks!");
  }
}

Results

Your answer Correct answer
1. class
2. main
3. System

Grouping: looking back at our example:

public class Main
{
  public static void main(String[] args)
  {
    System.out.println("Hello, World!");
  }
}

The class, Main, contains the main method, which contains the code to print "Hello, World!" This concept of containment, formally called encapsulation when relating to a class containing fields, variables, methods, and various other properties (covered later), is the essence of a group containing something.

Anything inside of set braces {...} is a member of the group. A group can be something like a class, method, conditional statement, or loop, where everything within its set braces belongs to it.

Naming Conventions:

*We will talk about classes, keywords, variables, and methods later

camelCase is a naming convention where the first character of the first word is lowercase, and then every successive word's first character is Uppercase; example: lowerUpper

Activity 2) Identify the correct naming







Results

Your answer Correct answer
1a. true
1b. false
1c. true
1d. false
1e. true

You might be wondering what int myInt; and double d; are, which leads us to the next topic: variables and data types.


1.2: Variables and Data Types
(All Topics)

---

---

---

---

---


1.3: Operators
(All Topics)

---

---

---

---

---


1.4: Input/Output
(All Topics)

---

---

---

---

---


1.5: Conditionals
(All Topics)

---

---

---

---

---


1.6: Loops
(All Topics)

---

---

---

---

---


1.7: Arrays, ArrayLists, and 2-D Arrays
(All Topics)

---

---

---

---

---


1.8: Methods and Recursion
(All Topics)

---

---

---

---

---


1.9: Encapsulation, Classes, and Objects
(All Topics)

---

---

---

---

---


2.1: Constructors and Parameters
(All Topics)

---

---

---

---

---


2.2: Keywords and Accessibility
(All Topics)

---

---

---

---

---


2.3: Getters and Setters
(All Topics)

---

---

---

---

---


2.4: Inheritance and Polymorphism
(All Topics)

---

---

---

---

---


2.5: Interfaces and Packages
(All Topics)

---

---

---

---

---


2.6: String Methods and Escapes
(All Topics)

---

---

---

---

---


2.7: Abstraction, Generics, and CompareTo
(All Topics)

---

---

---

---

---


2.8: Comments and JavaDoc
(All Topics)

---

---

---

---

---


2.9: Exception Handling
(All Topics)

---

---

---

---

---