Hi!

  1. My metod has 4 int parameter, and return true if least one of those parameter
    can be dividable with 5. otherwise return false.
  2. if least two or three of those parameter can be dividable with 5.

Code:

class Test{
  public static void main(String[]args){
  NumberTest myNbr=new NumberTest();
  int  result=myNbr.getMinNbr(3,1,9,6);
  System.out.println(result);
}}

class NumberTest{

int divid=0;
public int getMinNbr(int nbr1,int nbr2, int nbr3, int nbr4){

  if(nbr1%5==0)
      delbart=nbr1;

   else if(nbr2%5==0)
       divid=nbr2;

   else if(nbr3%5==0)
       divid=nbr3;

   else if(nbr4%5==0)
       divid=nb;
                           return divid;
}}

My question:

  1. How I can return true or flase
  2. How the program puts out two or more digit if these are true.
  3. if all oh them have the same value.

thanks
Peter

you could use : public boolean function(int param1, int param2...){}

boolean is used to return true or false .....

and you can use if statements ... for your last two questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.