170 likes | 298 Views
Static Variables. Ferrari. String model. int topSpeed. static String color. Static Variables. 클래 스. 객 체. Ferrari. Ferrari. String model. String model. int topSpeed. int topSpeed. static String color. static String color. new Ferrari(). Static Variables. 클래 스. 객 체.
E N D
Static Variables Ferrari String model int topSpeed static String color
Static Variables 클래스 객체 Ferrari Ferrari String model String model int topSpeed int topSpeed static String color static String color new Ferrari()
Static Variables 클래스 객체 Ferrari Ferrari model = “Dino” String model topSpeed = 280 int topSpeed static String color static String color new Ferrari()
Static Variables 객체 객체 Ferrari Ferrari Ferrari Ferrari Ferrari model = “458” model = “Spider” model = “F50” model = “Dino” String model topSpeed = 224 topSpeed = 245 topSpeed = 196 topSpeed = 280 int topSpeed 객체 객체 static String color static String color static String color static String color static String color
Static Variables 객체 객체 Ferrari Ferrari Ferrari Ferrari Ferrari red red model = “Spider” model = “458” model = “F50” model = “Dino” String model topSpeed = 245 topSpeed = 280 topSpeed = 224 topSpeed = 196 int topSpeed 객체 객체 static String color static String color static String color static String color static String color Ferrari.color = red; red red
public class Main{ static int bob = 5; public static void main(String[] args){ System.out.println( Main.bob ); 5
public class Main{ static int bob = 5; public static void main(String[] args){ System.out.println( bob ); 5
public class Main{ static int bob = 5; public static void main(String[] args){ int bob = 2478; System.out.println( bob ); 2478
서로 달라요 public class Main{ static int bob = 5; public static void main(String[] args){ int bob = 2478; System.out.println( bob ); 2478
public class Main{ static int bob = 5; public static void main(String[] args){ int bob = 2478; System.out.println( Main.bob ); 5
public class Main{ static int bob = 5; public static void main(String[] args){ Main m = new Main(); System.out.println( m.bob ); 5
public class Main{ static int bob = 5; public static void main(String[] args){ Main m = new Main(); Main m2 = new Main(); System.out.println( m2.bob ); 5
public class Main{ static int bob = 5; public static void main(String[] args){ Main m = new Main(); Main m2 = new Main(); m.bob++; System.out.println( m2.bob ); 6
public class Main{ static int bob = 5; public static void main(String[] args){ Main m = new Main(); Main m2 = new Main(); m2.bob++; System.out.println( m2.bob ); 6
public class Main{ static int bob = 5; public static void main(String[] args){ Main m = new Main(); Main m2 = new Main(); Main.bob++; System.out.println( m2.bob ); 6
public class Main{ static int bob = 5; public static void main(String[] args){ Main m = new Main(); Main m2 = new Main(); bob++; System.out.println( m2.bob ); 6