... 아래 코드 보시면 private instance 부분에 static을 붙여놓았는데 static을 붙일... 이러면 굳이 instance 변수에 static을 붙일 필요가 없는것 아닌가요? 제가 개념을...
태그:
include <stdio.h> void func(int a, static int b) { a++; b++; } int main() { int i; static int a=1; static int b = 1; for(i=0 ; i<5 ; i++) func(a, b); printf("%d, %d\n", a, b); } 답은 1...
태그:
class MethodExample1 { public static void main(String args... 메소드를 static으로 선언해주니까 컴파일에러가... /* * static 메소드는 객체 생성없이 바로 호출할...
태그:
static은 class에서만 써야 되는지 궁금 합니다 그냥 일반함수에 사용해봤는데 예를들면 void a() { static int a; a++; }... 질문하신 static변수가 올라갑니다. 다음으로 스택...
태그:
c++에서 class의 맴버변수 앞에 static를 붙이면 해당 클래스로 정의한 모든 객체들이 static즉 정적 변수를 공유한다고 알고 있습니다. 근데 static로...
태그:
public class StaticTest3 { public static int var1 = 0; // instance 변수 public int var2 = 0; // static 변수 선언 public static void main(String [] args) { StaticTest3 st1 = new...
태그:
남은 잔액을 static으로 뒀는데 할때마다... static int total; printf("저축할 금액:"); scanf_s("%d... static int total; printf("인출할 금액:"); scanf_s("%d...
태그:
... 하면 static선언이 되지 않은 메소드라고... public static void main(String args[]) { init() ; } public... init()에 static을 붙인다. 2. App p = new App(); p.init...
태그:
... public class Hello { public static void main(String... i++) { static String token = st.nextToken(); System.... token에 static을 선언했는데 Exception in...
태그:
... public class father{ static JFrame frame = new JFrame("test"); static sun Sun = new sun... frame.setVisible(true); } public static void main(String[] args) { father draws = new...
태그: