Uploaded December 2024 | Updated September 2026, 2 weeks ago
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args) {
// super = Refers to the parent class
// Used in constructors and method overriding
// Calls the parent constructor to initialize attributes
Person person = new Person("Tom", "Riddle");
Student student = new Student("Harry", "Potter", 3.25);
Employee employee = new Employee("Rubeus", "Hagrid", 50000);
}
}
public class Person {
String first;
String last;
Person(String first, String last){
this.first = first;
this.last = last;
}
void showName(){
System.out.println(this.first + " " + this.last);
}
}
public class Student extends Person{
double gpa;
Student(String first, String last, double gpa){
super(first, last);
this.gpa = gpa;
}
void showGPA(){
System.out.println(this.first + "'s gpa is: " + this.gpa);
}
}
public class Employee extends Person{
int salary;
Employee(String first, String last, int salary){
super(first, last);
this.salary = salary;
}
void showSalary(){
System.out.println(this.first + "'s salary is $" + this.salary);
}
}
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args) {
// super = Refers to the parent class
// Used in constructors and method overriding
// Calls the parent constructor to initialize attributes
Person person = new Person("Tom", "Riddle");
Student student = new Student("Harry", "Potter", 3.25);
Employee employee = new Employee("Rubeus", "Hagrid", 50000);
}
}
public class Person {
String first;
String last;
Person(String first, String last){
this.first = first;
this.last = last;
}
void showName(){
System.out.println(this.first + " " + this.last);
}
}
public class Student extends Person{
double gpa;
Student(String first, String last, double gpa){
super(first, last);
this.gpa = gpa;
}
void showGPA(){
System.out.println(this.first + "'s gpa is: " + this.gpa);
}
}
public class Employee extends Person{
int salary;
Employee(String first, String last, int salary){
super(first, last);
this.salary = salary;
}
void showSalary(){
System.out.println(this.first + "'s salary is $" + this.salary);
}
}

![MongoDB comparison operators explained
#MongoDB #course #tutorial
db.students.find({name:{$ne:Spongebob}})
db.students.find({age:{$lt:20}})
db.students.find({age:{$lte:27}})
db.students.find({age:{$gt:27}})
db.students.find({age:{$gte:27}})
db.students.find({gpa:{$gte:3, $lte:4}})
db.students.find({name:{$in: [Spongebob, Patrick, Sandy]}})
db.students.find({name:{$nin: [Spongebob, Patrick, Sandy]}}) MongoDB comparison operators explained](https://i.ytimg.com/vi/MHGKFvNLwfU/mqdefault.jpg)

![Learn function prototypes in 5 minutes! π
#coding #programming #cprogramming
void hello(char name[], int age);
bool ageCheck(int age);
// function prototype = Provide the compiler w/ information about a functions:
// name, return type, and parameters before its actual definition.
// Enables type checking and allows functions to be used before
// theyre defined.
// Improves readability, organization, and helps prevent errors. Learn function prototypes in 5 minutes! π](https://i.ytimg.com/vi/NEj2H7SoTzQ/mqdefault.jpg)


![Useful string methods in Java! π§΅
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args) {
String name = Bro Code;
int length = name.length();
char letter = name.charAt(0);
int index = name.indexOf( );
int lastIndex = name.lastIndexOf(o);
name = name.toUpperCase();
name = name.toLowerCase();
name = name.trim();
name = name.replace(o, a);
if(name.isEmpty()){
System.out.println(Your name is empty);
}
else{
System.out.println(Hello + name);
}
if(name.contains( )){
System.out.println(Your name contains a space);
}
else{
System.out.println(Your name DOESNT contain any spaces);
}
if(name.equalsIgnoreCase(password)){
System.out.println(Your name cant be password);
}
else{
System.out.println(Hello + name);
}
}
} Useful string methods in Java! π§΅](https://i.ytimg.com/vi/Ntl3DxhyrQQ/mqdefault.jpg)



![Learn Java getters and setters in 10 minutes! π
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args) {
// They help protect object data and add rules for accessing or modifying them.
// GETTERS = Methods that make a field READABLE.
// SETTERS = Methods that make a field WRITEABLE.
Car car = new Car(Charger, Yellow, 10000);
car.setColor(Blue);
car.setPrice(5000);
System.out.println(car.getColor() + + car.getModel() + + car.getPrice());
}
}
public class Car {
private String model;
private String color;
private int price;
Car(String model, String color, int price){
this.model = model;
this.color = color;
this.price = price;
}
String getModel(){
return this.model;
}
String getColor(){
return this.color;
}
String getPrice(){
return $ + this.price;
}
void setColor(String color){
this.color = color;
}
void setPrice(int price){
this.price = price;
}
} Learn Java getters and setters in 10 minutes! π](https://i.ytimg.com/vi/OjrR_C_UPjc/mqdefault.jpg)