Thursday 15 September 2011

java - how to implement this scenario car class have 3 methods(m1,m2,m3) and engineer can access m1 and m2, and driver can access m1 and m3 mthod -



java - how to implement this scenario car class have 3 methods(m1,m2,m3) and engineer can access m1 and m2, and driver can access m1 and m3 mthod -

i have auto class , 3 methods m1(),m2(),m3(). engineer can access m1() , m2()method ,driver can m1() , m3(),but engineer restrict m3()(should not provide accessing method) , driver restrict m2()(should not provide accessing method)method how implement scenario in java class car{

}

declare auto interface m3() method , create engineer interface extends auto interface , has m2() method , driver interface m3() method , extends auto interface.now write concreteengineer class implements engineer interface , concretedriver class implement driver interface.

java

No comments:

Post a Comment