I’m pretty sure void means it won’t return any value. out means something is going out from the code into the console. println will print it’s argument in a new line.

// needed to work code
public class HelloStatic { // name must start capitalized
    // Java standard runtime entry point
    public static void main(String[] args) {    // the code in main will run
        System.out.println("Hello World!"); // prints text
    }
}
// A method call allows us to execute code that is wrapped in Class
HelloStatic.main(null);   // Class prefix allows reference of Static Method
Hello World!

what I think is happening is HelloObject() is a function for giving hello a value, and getHello us a function for returning the value of hello. iIn the main code, ho is given the value of HelloObject() and is printed with getHello() tacked on to it. The ho will give hello value and the getHello() tacked on returns the value of hello.

// Define Class with Constructor returning Object
public class HelloObject {
    private String hello;   // instance attribute or variable
    public HelloObject() {  // used to give an object data
        hello = "Hello, World!";
    }
    public String getHello() {  // getter, returns value from inside the object
        return this.hello;  // return String from object
    }
    public static void main(String[] args) {    
        HelloObject ho = new HelloObject(); // Instance of Class (ho) is an Object via "new HelloObject()"
        System.out.println(ho.getHello()); // Object allows reference to public methods and data
    }
}
// IJava activation
HelloObject.main(null);
Hello, World!

There’s a word for this but I forgot what it was. There’s two functions with the same function name, but one takes an argument and the other doesn’t. The two have different code, but the system knows which one you’re calling based on if there’s an argument or not. To print the variable, there must be a getter or else the system won’t recognize it as a variable.

// Define Class
public class HelloDynamic { // name the first letter of class as capitalized, note camel case
    // instance variable have access modifier (private is most common), data type, and name
    private String hello;
    // constructor signature 1, public and zero arguments, constructors do not have return type
    public HelloDynamic() {  // 0 argument constructor
        this.setHello("Hello, World!");  // using setter with static string
    }
    // constructor signature, public and one argument
    public HelloDynamic(String hello) { // 1 argument constructor
        this.setHello(hello);   // using setter with local variable passed into constructor
    }
    // setter/mutator, setter have void return type and a parameter
    public void setHello(String hello) { // setter
        this.hello = hello;     // instance variable on the left, local variable on the right
    }
    // getter/accessor, getter used to return private instance variable (encapsulated), return type is String
    public String getHello() {  // getter
        return this.hello;
    }
    // public static void main(String[] args) is signature for main/drivers/tester method
    // a driver/tester method is singular or called a class method, it is never part of an object
    public static void main(String[] args) {  
        HelloDynamic hd1 = new HelloDynamic(); // no argument constructor
        HelloDynamic hd2 = new HelloDynamic("Hello, Nighthawk Coding Society!"); // one argument constructor
        System.out.println(hd1.getHello()); // accessing getter
        System.out.println(hd2.getHello()); 
    }8
}
// IJava activation
HelloDynamic.main(null);
Hello, World!
Hello, Nighthawk Coding Society!
public class Main { //this is the class, a blueprint for the objects
    int x = 5; //this is an attribute, it is a variable within the class
    int y = 3;

    public static void main(String[] args) {
        Main myObj = new Main();  //this is the object, it copies the class
        Main myObj2 = new Main();
        System.out.println(myObj.x); //this will print the value of x in the object myObj
        System.out.println(myObj2.x);
    }
}

Main.main(null)
5
5

you can call a class from a different code cell.

class Second {
    public static void main(String[] args) {
        Main myObj = new Main();
        System.out.println(myObj.x);
    }
}

Second.main(null)
5

you can also add final before int x; to make the value unchangable

public class Main2 { 
    int x; //you can create the function without a variable

    public static void main(String[] args) {
        Main2 myObj = new Main2();
        Main2 myObj3 = new Main2();
        myObj.x = 40; // and set the value later
        myObj3.x = 40;
        System.out.println(myObj.x);
        System.out.println(myObj3.x);
        myObj.x = 30; // or you could override the value (works with preset values)
        System.out.println(myObj.x); 
        System.out.println(myObj3.x); //myObj3 value will remain unchanged when myObj value is changed
    }
}

Main2.main(null)
40
40
30
40

A class can have any number of attributes

public class Name {
    String fname = "John";
    String lname = "Smith";
    int age = 30;

    public static void main(String[] args) {
        Name myObj = new Name();
        System.out.println("Name: " + myObj.fname + " " + myObj.lname);
        System.out.println("Age: " + myObj.age);
    }
}

Name.main(null)
Name: John Smith
Age: 30

methods in java seem to work similar to functions in javascript and python. static and public have different functions. static can be accessed without objects and public can only accessed through objects

public class Methodss {
    static void myMethod() { //this static part
      System.out.println("Hello World!");
    }

    public static void main(String[] args) {
      myMethod();
    }
}
Methodss.main(null)
Hello World!

you can access multiple methods thorugh objects.

public class Methosd {
    public void fullThrottle() {
      System.out.println("The car is going as fast as it can!");
    }
  
    public void speed(int maxSpeed) {
      System.out.println("Max speed is: " + maxSpeed);
    }
  
    public static void main(String[] args) {
      Methosd myCar = new Methosd();
      myCar.fullThrottle();
      myCar.speed(200);
    }
}
Methosd.main(null)
The car is going as fast as it can!
Max speed is: 200
public class CONSTRUCTORSS {
    int x;
  
    public CONSTRUCTORSS(int y) {
      x = y;  //this constructor will give x the desired value when creating an object
    }
    // you can use as many parameters as you want
    public static void main(String[] args) {
        CONSTRUCTORSS myObj = new CONSTRUCTORSS(5); // x now has the value of 5 in myObj
      System.out.println(myObj.x);
    }
}
CONSTRUCTORSS.main(null)
5

this is called encapsulation, the value of name can only be changed and accessed through setters and getters

public class Person {
    private String name; // private = restricted access
  
    // Getter
    public String getName() {
      return name;
    }
  
    // Setter
    public void setName(String newName) {
      this.name = newName;
    }

    public static void main(String[] args) {
        Person myObj = new Person();
        myObj.setName("John"); // Set the value of the name variable to "John"
        System.out.println(myObj.getName());
      }
}
Person.main(null)
John

take inputs

import java.util.Scanner;  // Import the Scanner class

class Main {
  public static void main(String[] args) {
    Scanner myObj = new Scanner(System.in);  // Create a Scanner object
    System.out.println("Enter username");

    String userName = myObj.nextLine();  // Read user input
    System.out.println("Username is: " + userName);  // Output user input
  }
}
Main.main(null)