String
β String is reference String is reference value can create String as literal or as instance String str1= "hello"; //literal String str2 = new String("hello"); //instance π° two code is...
β String is reference String is reference value can create String as literal or as instance String str1= "hello"; //literal String str2 = new String("hello"); //instance π° two code is...
β Summary Immutable: cannot change reference value 1οΈβ£ final field, 2οΈβ£ no setter β Primitive π Reference π Primitive int a = 10; int b = a; b = 20; β μ΄μ aμ κ°μ? μ¬μ ν 10 β μ΄μ bμ...
β Object class Object class is parent of all Java classes highest parent of all Java class μλ°μ μ΅μμ λΆλͺ¨ ν΄λμ€ implicitly imports object public class Parent extends Object (extends Obje...
β OCP Open for extension: new code should be able to be extended νμ₯μλ μ΄λ €μκ³ Closed for modification: old code must not be modified λ³κ²½μλ λ«νμμ΄μΌ νλ€ β How t...
β Summary interface is like pure abstract class cannot create instance MUST be overrided by child class implements can implements several interface β Interface ...
β Abstract class Parent class, but can NOT be created as instance λλ¬Όμ΄λΌλ κ°λ μμ κ°μμ§, κ³ μμ΄ λ±μ΄ μμ§λ§ "λλ¬Ό"μ΄λΌκ³ νλ λλ¬Όμ μμ λ°λΌμ λλ¬Όμ μΈμ€ν΄μ€λ₯Ό μμ±νλ©΄ μ λ¨ Animal class: abstract class Dog class, Ca...
βοΈ extends βοΈ method overriding β Polymorphism: parent can become child parent class child class extends parent class 1οΈβ£ Polymorphism: parent CAN become child instance child CAN N...
β Final final: can not change after initialization final value can not be altered after initializatoin μ²μ κ° ν λΉ νμλ λ³μμ κ°μ λ³κ²½νμ§ λͺ»νκ² λ§μλ²λ¦°λ€ ππ» without final int data0; data0 = 10; ...
β Extends if extends, extends the field and method of parent class public class Car { public void move(){} } public class GasCar extends Car{ public void fillGas(){} } public class...
β Method, Stack, Heap βοΈ Method class βοΈ Stack methods program is run βοΈ Heap Instance created new class instance, array π‘ Method shared data to run program class...