•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 401,534 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,385 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1235 | Replies: 1
![]() |
•
•
Join Date: Sep 2004
Posts: 24
Reputation:
Rep Power: 4
Solved Threads: 0
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.
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
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.
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Simple Java question (Java)
- Traveling Salesman Problem ... question about Triangle Inequality (Computer Science and Software Design)
- Java Question (Java)
- A Java Question?? (Java)
- Java Question (Java)
- Please help me whit this java question. (Java)
Other Threads in the Java Forum
- Previous Thread: Primality Test
- Next Thread: Help with Java code



Linear Mode