/** This is class Printer.
** It prints different things
** @author Claudia Niederee
** @version 1
*/
public class Printer2
{
private String name = "HP-Printer";
/** This method sets the name of the printer
** @param newName new name of the printer
** @see Printer2
*/
public void setName(String newName){
name = newName;
}
/** This method returns the name of the printer.
** @return name of the printer
*/
public String getName (){
return name;
}
/** This method prints the name of the printer.
*/
public void printName(){
System.out.println(name);
}
/** This method prints the difference between two numbers
** @param a first number
** @param b second number
*/
public void printDifference(int a, int b){
System.out.println(a + " - " + b + " = " + (a-b));
}
public static void main (String [] args){
// Object creation
Printer2 p = new Printer2();
p.printName();
p.printDifference(4, 3);
//Passing a parameter into the program
// p.setName(args[0]);
// p.printName();}
}
}