본문 바로가기

selfstarter

검색하기
selfstarter
프로필사진 selfstarter

  • 분류 전체보기 (158)
    • App (65)
      • Android (59)
      • Flutter (6)
    • Server (46)
      • Java (24)
      • Spring (19)
      • AWS (3)
    • Web (25)
      • Html (9)
      • Javascript (15)
      • React (1)
    • ML (8)
    • Etc (10)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags
  • Eclipse
  • FLUTTER
  • css
  • CSS사용법
  • 안드로이드
  • fragment
  • Exception
  • Android
  • java error
  • Java
  • release unsigned
  • R프로그래밍
  • Android Apk 이름 변경
  • Program type already present
  • android error
  • DataTable
  • android fragment
  • Android Apk
  • apache gzip
  • MySQL
  • JavaScript
  • html
  • spring
  • Kotlin
  • Firebase
  • error
  • release Apk
  • jQuery
  • Android Apk 이름
  • tomcat
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록non-static method 'getclass()' cannot (1)

selfstarter

non-static method 'getclass()' cannot be referenced from a static context 해결방법

non-static method 'getclass()' cannot be referenced from a static context 해결방법 Error non-static method 'getclass()' cannot be referenced from a static context Code public static final String className = getClass().getSimpleName().trim();Case class의 전역에서 사용하려고 했다. 그런데 getClass는 static Method가 아니므로 전역에서 사용할 수 없다. Soution 정적메소드가 아닌 getClass()말고 클래스이름.class을 쓰면 된다

Server/Java 2020. 5. 23. 12:59
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바