Javaのクラスでつまずいている者です。

ttp://sourcepost.sytes.net/sourcepost/sourceview.aspx?source_id=29366

このようなソースの場合、
class Employeeの、

public Employee(String n, double s)
{
name = n;
salary = s;
id = 0;
}
や
public String getName()
{
return name;
}
はどういった役割をしているのでしょうか?
また、
public void setId()
{
id = nextId; // set id to next available id
nextId++;
}
もどういった役割なのでしょうか?
なぜ、getとsetを設定するのかが分からず、混乱しています。