about Lunar lander in Android (inner class) -
i new android.
also new java, please feel free give me advice, appreciate it.
the question in lunarlander.java
/** handle thread that's running animation. */ private lunarthread mlunarthread; /** handle view in game running. */ private lunarview mlunarview;
but in lunarview.java
class lunarview extends surfaceview implements surfaceholder.callback { /** handle application context, used e.g. fetch drawables. */ private context mcontext; /** pointer text view display "paused.." etc. */ private textview mstatustext; class lunarthread extends thread
i have learned c , c++
so can't figure out why can call inner class??
classes , fields without modifiers private or protected can accessible class in same package. can access lunarthread
lunarview.lunarthread
or import class lunarthread
done in lunarlander.java:
import com.example.android.lunarlander.lunarview.lunarthread;
see book java references.
Comments
Post a Comment