Reputation: 101
class1 has this method:
private Bitmap scaleImage() {
Bitmap nad = BitmapFactory.decodeFile(path);
return nad;
}
I need to use this nad object in class2...I tried to look through some java documentation on access class properties,but nothing worked..
Upvotes: 1
Views: 367
Reputation: 2047
You have declared you method as private
. That prevents other classes from invoking it. You usually use the private
modifier to guarantee encapsulation, but for your case you should use:
public
, meaning that any other class can invoke scaleImage()
, or, protected
to restrict it to the classes inheriting from class1
and the classes in its same package, or, For further details on access modifiers: http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
Upvotes: 1