Home >Java >javaTutorial >Water bottle task
public class Waterbottle {
public static void main(String[] args) { // TODO Auto-generated method stub
Waterbottle glass = new Waterbottle();
glass.drink();
}
public void drink()
{
System.out.println("Drinking Water");
}
}
public class Viewer {
public static void main(String[] args) { // TODO Auto-generated method stub Tv LG = new Tv(); LG.Watch(); }
}
The above is the detailed content of Water bottle task. For more information, please follow other related articles on the PHP Chinese website!