java.lang.Error: Unresolved compilation problems: Cannot make a static reference to the non-static field x Cannot make a static reference to the non-static method addOne() from the type StaticTest

Coderanch | Paul Yule | 8 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Static mmbers

    Coderanch | 8 years ago | Paul Yule
    java.lang.Error: Unresolved compilation problems: Cannot make a static reference to the non-static field x Cannot make a static reference to the non-static method addOne() from the type StaticTest

    Root Cause Analysis

    1. java.lang.Error

      Unresolved compilation problems: Cannot make a static reference to the non-static field x Cannot make a static reference to the non-static method addOne() from the type StaticTest

      at tests.StaticTest.main()
    2. tests
      StaticTest.main
      1. tests.StaticTest.main(StaticTest.java:6)
      1 frame