As to your first question, in Java a program is contained in a class. The primary purpose of a class is to define and manipulate an object you would like to create. For example,
public class Cow
{
public int age;
public String color;
public Cow()
{
age = 3;
color = "red";
}
public void graze()
{
......
Now, I don't know how much you know about java, but hopefully my code segment can be somewhat helpful. Above, I have created a Cow class. The public Cow() is a constructor that defines what variables make up a Cow object. The graze method is an example of a method that could be applied to a Cow object.
Anyway, I don't know how helpful this was, but I hope it helped. I can explain things more if necessary.