Horje
java private method can't call public method Code Example
java private method can't call public method
class X{
    private int field = 1;
    private void method(){}
    void foo(X x){
        x.field = 2;
        x.method(); // this is OK, because we are accessing members from instance of X 
                    // via reference of class X (which is same class as this one)
    }

    void bar(Y y){// = lets assume that Y extends X
        y.field = 3;
        y.method(); // ERROR: we can't access `method()` 
    }
}




Java

Related
android capture view and animation Code Example android capture view and animation Code Example
Create JDBC connection using properties file Code Example Create JDBC connection using properties file Code Example
difference between final and constant in java Code Example difference between final and constant in java Code Example
how to put all words from a file in an array java Code Example how to put all words from a file in an array java Code Example
spring mongodb Code Example spring mongodb Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8