Uploaded December 2024 | Updated September 2026, 1 week ago
#java #javatutorial #javacourse
This is a quiz game you can create using Java. The purpose of coding this quiz game is to help us become more familiar with arrays.
#java #javatutorial #javacourse
This is a quiz game you can create using Java. The purpose of coding this quiz game is to help us become more familiar with arrays.
![Learn C programming variables easy! β
#coding #programming #cprogramming
00:00:00 int
00:04:06 float
00:07:35 double
00:09:26 char
00:11:34 char[]
00:14:37 bool
00:18:55 extra details
// variable = A reusable container for a value.
// Behaves as if it were the value it contains.
// int = whole numbers (4 bytes in modern systems)
// float = single-precision decimal number (4 bytes)
// double = double-precision decimal number (8 bytes)
// char = single character (1 byte)
// char[] = array of characters (size varies)
// bool = true or false (1 byte) Learn C programming variables easy! β](https://i.ytimg.com/vi/WrFEtUzVcnw/mqdefault.jpg)
![Learn runtime polymorphism in 5 minutes! π€·ββοΈ
#java #javatutorial #javacourse
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Runtime polymorphism = When the method that gets executed is decided
// at runtime based on the actual type of the object.
Scanner scanner = new Scanner(System.in);
Animal animal;
System.out.print(Would you like a dog or a cat? (1 = dog, 2 = cat): );
int choice = scanner.nextInt();
if(choice 1){
animal = new Dog();
animal.speak();
}
else if(choice 2){
animal = new Cat();
animal.speak();
}
}
} Learn runtime polymorphism in 5 minutes! π€·ββοΈ](https://i.ytimg.com/vi/YDKHfqzaF30/mqdefault.jpg)



![Learn Python generator expressions in 9 minutes! β»οΈ
#python #coding #programming
# Generator Expression = Similar to a list comprehension but uses () instead of []
# Creates a generator (iterator) that yields values one at a time
# No need to define a function or use yield
# Less flexible than a gen func and not reusable
# gen object = (expression for value in iterable if condition) Learn Python generator expressions in 9 minutes! β»οΈ](https://i.ytimg.com/vi/ZBlxaXMN_hU/mqdefault.jpg)
![Learn CONSTRUCTORS in 10 minutes! π¨
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args) {
// constructor = A special method to initialize objects
// You can pass arguments to a constructor
// and set up initial values
Student student1 = new Student(Spongebob, 30, 3.2);
Student student2 = new Student(Patrick, 34, 1.5);
Student student3 = new Student(Sandy, 27, 4.0);
System.out.println(student1.name);
System.out.println(student1.age);
System.out.println(student1.gpa);
System.out.println(student1.isEnrolled);
System.out.println(student2.name);
System.out.println(student2.age);
System.out.println(student2.gpa);
System.out.println(student2.isEnrolled);
System.out.println(student3.name);
System.out.println(student3.age);
System.out.println(student3.gpa);
System.out.println(student3.isEnrolled);
student1.study();
student2.study();
student3.study();
}
}
public class Student {
String name;
int age;
double gpa;
boolean isEnrolled;
Student(String name, int age, double gpa){
this.name = name;
this.age = age;
this.gpa = gpa;
this.isEnrolled = true;
}
void study(){
System.out.println(this.name + is studying);
}
} Learn CONSTRUCTORS in 10 minutes! π¨](https://i.ytimg.com/vi/ZD7CB6wKg8A/mqdefault.jpg)
![Learn Java while loops in 12 minutes! βΎοΈ
#java #javatutorial #javacourse
00:00:00 introduction
00:01:40 example 1
00:02:45 infinite loop example
00:03:52 example 2
00:06:40 example 3
00:08:53 do while loop
00:09:53 example 4
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// EXAMPLE 1
String name = ;
while(name.isEmpty()){
System.out.print(Enter your name: );
name = scanner.nextLine();
}
System.out.println(Hello + name);
// EXAMPLE 2
String response = ;
while(!response.equals(Q)){
System.out.print(Press Q to quit: );
response = scanner.next().toUpperCase();
}
System.out.println(You have quit);
scanner.close();
}
} Learn Java while loops in 12 minutes! βΎοΈ](https://i.ytimg.com/vi/ZjHJrmYknrk/mqdefault.jpg)

![Arrays of structs are easy! ποΈ
#coding #programming #cprogramming
// array of structs = Array where each element contains a struct {}
// Helps organize and groups together related data
Car cars[] = {{Mustang, 2025, 32000},
{Corvette, 2026, 68000},
{Challenger, 2024, 29000}}; Arrays of structs are easy! ποΈ](https://i.ytimg.com/vi/ZwSyuqbeN0c/mqdefault.jpg)
