Skip to content

Commit

Permalink
멀티스레드로 동작하도록 main 수정 + 총 박수 횟수 몇번인지 세는 class추가
Browse files Browse the repository at this point in the history
  • Loading branch information
silano08 committed Apr 27, 2024
1 parent 59f9bdf commit e1f42ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/JavaPractice/ThreeSixNineGame/ClapCounter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package JavaPractice.ThreeSixNineGame;

public class ClapCounter {
// 박수를 친 횟수를 가지고 있는 클래스 만들기
private int clapTotalCount = 0;

/**
박수를 친 횟수를 출력하는 메소드 만들기
결과를 sout 으로 화면에 출력해주세요.
*/
void printClapCount() {
System.out.println("모든 game의 박수 횟수:" + clapTotalCount);
}

synchronized void countClap(String clap) {
clapTotalCount += (clap.length() / 4) ;
}
}

0 comments on commit e1f42ee

Please sign in to comment.