Try to use interfaces from the start, they will make your life easier. Basicly, a interface is a list of methods (functions) that the class using the interface will have to implement. if a class uses a certain interface, you know that the class supports the methods in it.

For example, if you have this interface in a file named Person.java:

interface Person
{
public void setName(String name);
public String getName();
public void setPhoneNumber(int phoneNumber);
public int getPhoneNumber();
}

... and this code in another file named PersonImpl.java...

import java.io.*;

public class PersonImpl implements Person
{
private String name;
private int number;

public void setName(String name){
this.name = name;
}

public String getName(){
return name;
}

public void setPhoneNumber(int phoneNumber){
this.number = phoneNumber;
}


public int getPhoneNumber(){
return number;
}

public String toString(){
return name + "\t" + number;
}
}


... you have yourself a nice program to start with. This example uses object oriented principles with get/set methods for the data member variables (name and number).

You also need a Main.java file where the execution can begin:

public class Main
{
public static void main(String[] args)
{
Person p = new PersonImpl();
p.setName("Bill Gates");
p.setPhoneNumber("666");
}
}

The code above creates a object from the PersonImpl class (which uses the interface Person). It then uses the methods of the class to put some data into the object.

Anyways, good luck with your programming. I think Java is a good place to start.

/
/ 0x0