Learn the STATIC keyword in 8 minutes! ๐Ÿค @BroCodez
Learn the STATIC keyword in 8 minutes! ๐Ÿค  @BroCodez
Uploaded December 2024 | Updated September 2026, 1 week ago
#java #javatutorial #javacourse

public class Main {
public static void main(String[] args) {

// static = Modifies a variable or method belong to the class,
// rather than to any specific object.
// Commonly used for utility methods or shared resources.

Friend friend1 = new Friend("Spongebob");
Friend friend2 = new Friend("Patrick");
Friend friend3 = new Friend("Squidward");
Friend friend4 = new Friend("Sandy");

Friend.showFriends();
}
}

public class Friend {

static int numOfFriends;
String name;

Friend(String name){
this.name = name;
numOfFriends++;
}

static void showFriends(){
System.out.println("You have " + numOfFriends + " total friends");
}
}
Learn the STATIC keyword in 8 minutes! ๐ŸคNested if statements are easy! ๐ŸŽŸ๏ธRealloc in C explained easy! ๐ŸšขLearn how to enter user input in C! โŒจ๏ธCode a C digital clock in 10 minutes! โŒšCode a dice roller program with Java! ๐ŸŽฒLearn hexadecimal in 0x79 seconds #coding #computerscience #programmingLearn enums in 8 minutes! ๐Ÿ“…Learn Java nested loops in 8 minutes! โžฟMatplotlib labels in 6 minutes! ๐Ÿท๏ธLearn the Java ternary operator in 5 minutes! โ”Learn Java multithreading in 8 minutes! ๐Ÿงถ
Bro Code |

Learn the STATIC keyword in 8 minutes! ๐Ÿค

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER