Users Pricing

forum

home / developersection / forums / access private method another class using constructor in java

Access private method another class using constructor in java

Anonymous User 2272 04 Feb 2015

So, i created a method in a class called Lotion and I named it read() this method takes the user's input. I was told by my instructor that the method read() had to be private. However, he said that his demo/tester class should be able to access the method read(). He gave us a hint saying we had to use a constructor. But unfortunately, I still don't understand how it's supposed to work. Can Someone please explain.

Thanks in advance.


I am a content writter !


2 Answers

Anonymous User 04 Feb 2015 Accepted Answer