Hye..Anybody can help me? I need some help here..
Below is program 1 (main program)

import java.util.*;
public class Staff
{
public double weeklyIncome, monthlyIncome;
public String name, staffId;

[B]/*how to code the input method to read the staff name,
staff id and weekly salary from a keyboard?*/[/B]

}


//Program 1
public class Salary
{
public static void main(String[]arg)
{
Staff[]staff = new Staff[12];
Staff data=new Staff();
data.input(staff);
data.calculateMonthlyIncome(staff);
double max=data.maximum(staff);
}
}

Some tips?
Can anybody show me the some examples? :)

thank you

did you read the link?

class myClass{//demonstration class
    double var;//variable for demonstration class
    public myClass(){//this is a constructor
        var=3.1415926535;//set value for var
    }
    public myClass(double d){//this is a constructor with an argument
        var = d;//set the variable to parameter value
    }
    public void setVar(double d){//this is a method known as a setter
        var = d;//set the variable to the parameter value
    }
    public double getVar(){//this is a method known as a getter
        return var;//return the value of the value
    }
    public double plaintMethod(){//this is just a plain method
        return var*37;//return stuff
    }
}

i still recommend you read THIS LINK

I trust that you already have created the class: Staff. It should be like what sciwizeh has suggested.
This is an example on how to read from the keyboard:

Staff [] staff = Staff[12] //this is an ARRAY. It is not null, but these are: staff[0], staff[1], ...
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));

staff[0] = new Staff(); //staff[0] IS a Staff object.

String name =  keyboard.readLine(); //reads from the keyboard
staff[0].setName(name);
//read the rest of the elements that Staff should have

Use a for loop for the rest of the elements of the array

This article has been dead for over six months. Start a new discussion instead.