Uploaded December 2024 | Updated September 2026, 2 weeks ago
#java #javatutorial #javacourse
00:00:00 inheritance
00:05:10 multi-level inheritance
public class Main {
public static void main(String[] args) {
// Inheritance = One class inherits the attributes and methods
// from another class.
Dog dog = new Dog();
Cat cat = new Cat();
Plant plant = new Plant();
}
}
public class Organism {
boolean isAlive;
Organism(){
isAlive = true;
}
}
public class Plant extends Organism{
void photosynthesize(){
System.out.println("The plant absorbs sunlight");
}
}
public class Animal extends Organism{
void eat(){
System.out.println("This animal is eating");
}
}
public class Dog extends Animal{
int lives = 1;
void speak(){
System.out.println("The dog goes *woof*");
}
}
public class Cat extends Animal{
int lives = 9;
void speak(){
System.out.println("The cat goes *meow*");
}
}
#java #javatutorial #javacourse
00:00:00 inheritance
00:05:10 multi-level inheritance
public class Main {
public static void main(String[] args) {
// Inheritance = One class inherits the attributes and methods
// from another class.
Dog dog = new Dog();
Cat cat = new Cat();
Plant plant = new Plant();
}
}
public class Organism {
boolean isAlive;
Organism(){
isAlive = true;
}
}
public class Plant extends Organism{
void photosynthesize(){
System.out.println("The plant absorbs sunlight");
}
}
public class Animal extends Organism{
void eat(){
System.out.println("This animal is eating");
}
}
public class Dog extends Animal{
int lives = 1;
void speak(){
System.out.println("The dog goes *woof*");
}
}
public class Cat extends Animal{
int lives = 9;
void speak(){
System.out.println("The cat goes *meow*");
}
}
![Start using NumPy in 5 minutes! ๐ข
#coding #programming #numpy
This is an introduction to how to get started working with NumPy
1. open a terminal
2. pip install numpy
3. import numpy as np
4. array = np.array([1, 2, 3, 4]) Start using NumPy in 5 minutes! ๐ข](https://i.ytimg.com/vi/Gc-dwloxNFE/mqdefault.jpg)

![Code a rock paper scissors game with Java! ๐ฟ
#java #javatutorial #javacourse
This is a coding project for beginners to help you learn how to code. We will use the following previous topics: arrays, loops, logical operators, random numbers, and string methods.
import java.util.Random;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
// ROCK PAPER SCISSORS GAME
Scanner scanner = new Scanner(System.in);
Random random = new Random();
String[] choices = {rock, paper, scissors};
String playerChoice;
String computerChoice;
String playAgain = yes;
do{
System.out.print(Enter your move (rock, paper, scissors): );
playerChoice = scanner.nextLine().toLowerCase();
if(!playerChoice.equals(rock) && !playerChoice.equals(paper) && !playerChoice.equals(scissors)){
System.out.println(Invalid choice);
continue;
}
computerChoice = choices[random.nextInt(3)];
System.out.println(Computer choice: + computerChoice);
if(playerChoice.equals(computerChoice)){
System.out.println(Its a tie!);
}
else if((playerChoice.equals(rock) && computerChoice.equals(scissors)) ||
(playerChoice.equals(paper) && computerChoice.equals(rock)) ||
(playerChoice.equals(scissors) && computerChoice.equals(paper))){
System.out.println(You win!);
}
else{
System.out.println(You lose!);
}
System.out.print(Play again (yes/no): );
playAgain = scanner.nextLine().toLowerCase();
}while(playAgain.equals(yes));
System.out.println(Thanks for playing!);
scanner.close();
}
} Code a rock paper scissors game with Java! ๐ฟ](https://i.ytimg.com/vi/GsuEJ9QOPgk/mqdefault.jpg)


![Matplotlib scatter plots in 6 minutes! โจ
#python #coding #matplotlib
In this video we will create a basic scatter plot using Matplotlib.
Here is some sample data you can copy and paste for your convenience:
x1 = np.array([0, 1, 1, 2, 3, 4, 5, 6, 7, 7, 8])
y1 = np.array([55, 60, 65, 62, 68, 70, 75, 78, 82, 85, 87])
x2 = np.array([0, 1, 2, 2, 3, 4, 5, 6, 7, 8, 8])
y2 = np.array([50, 58, 65, 70, 72, 78, 83, 88, 92, 95, 97]) Matplotlib scatter plots in 6 minutes! โจ](https://i.ytimg.com/vi/HHrG5W530fk/mqdefault.jpg)

![Learn Java timertasks in 6 minutes! โฒ๏ธ
#java #javatutorial #javacourse
import java.util.Timer;
import java.util.TimerTask;
public class Main {
public static void main(String[] args) {
// Timer = Class that schedules tasks at specific times or periodically
// Useful for: sending notifications, scheduled updates, repetitive actions
// TimerTask = Represents the task that will be executed by the Timer
// You will extend the TimerTask class to define your task
// Create a subclass of TimerTask and @Override run()
Timer timer = new Timer();
TimerTask task = new TimerTask(){
@Override
public void run(){
System.out.println(Hello!);
}
};
timer.schedule(task, 0, 1000); // (task, delay, period)
}
} Learn Java timertasks in 6 minutes! โฒ๏ธ](https://i.ytimg.com/vi/HjzcZkzRDYs/mqdefault.jpg)

![Code a Java compound interest calculator in 7 minutes! ๐ธ
#java #javatutorial #javacourse
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Compound interest calculator
Scanner scanner = new Scanner(System.in);
double principal;
double rate;
int timesCompounded;
int years;
double amount;
System.out.print(Enter the principal amount: );
principal = scanner.nextDouble();
System.out.print(Enter the interest rate (in %): );
rate = scanner.nextDouble() / 100;
System.out.print(Enter the # of times compounded per year: );
timesCompounded = scanner.nextInt();
System.out.print(Enter the # of years: );
years = scanner.nextInt();
amount = principal * Math.pow(1 + rate / timesCompounded, timesCompounded * years);
System.out.printf(The amount after %d years is $%.2f, years, amount);
scanner.close();
}
} Code a Java compound interest calculator in 7 minutes! ๐ธ](https://i.ytimg.com/vi/IgdIfGW-cVU/mqdefault.jpg)
