권력이양

2026년 10월 16일 09:30분

사무엘하 4장에서 이스보셋이 피살되고 권력이 다윗에게로 넘어가는 조건이 갖춰집니다. 권력 이양은 단계를 밟아 이루어집니다. 나는 권한 이전 트랜잭션을 구현했습니다.

package com.jesusbornd.samuel2;

public class Samuel2_04_Chapter_Lv1 {
    static String currentKing = "이스보셋";
    static void transferPower(String from, String to, String reason) {
        System.out.printf("권력 이양: %s → %s (사유: %s)%n", from, to, reason);
        currentKing = to;
        System.out.println("현재 왕: " + currentKing);
    }
    public static void main(String[] args) {
        System.out.println("현재 왕: " + currentKing);
        transferPower("이스보셋", "다윗", "이스보셋 피살");
    }
}

current_king = "이스보셋"

def transfer_power(from_: str, to: str, reason: str):
    global current_king
    print(f"권력 이양: {from_} → {to} (사유: {reason})")
    current_king = to
    print(f"현재 왕: {current_king}")

print(f"현재 왕: {current_king}")
transfer_power("이스보셋", "다윗", "이스보셋 피살")

Comments

Avatar
 2026년 10월 16일 11:36분

권력은 양도되는 것이지 빼앗기는 것이 아닙니다.



Search

← 목록으로