For Programmers: Free Programming Magazines  


Home > Archive > Java Help > September 2006 > Need Help with one thing...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Need Help with one thing...
rbd

2006-09-18, 5:48 pm

If someone could offer some advice on this it would be great...
I have two files... a client file and server file. The client is this right here...it should only contain the main method and should call on the server file. I have defined everything on the server file but dont know how to call the isPrime or isPowerOf2 function. As you can see, I tried to call em, but Im asked to go from 1-100 and get the Prime and Power of 2 numbers...how do I go about doing this?
Thanks for all and any help

import java.util.*

public static void main(String []args){
Server srv = new Server();
int result=gcd(48, 30);
System.out.print("Print result of GCD: " + result);
int newResult=gcd(-48, 15);
System.out.print("Print New Result of GCD: " + newResult);
int another=gcd(48, -21);
System.out.print("Print Another Result of GCD: " + another);
System.out.println(isPrime);
System.out.println(isPowerOf2);

}
jokeje

2006-09-25, 9:24 am

I see that you are instatiating a new server, but I do not see where you are actually setting the server equal to something or using it in your code. If the functions (isPrime and isPowerOf2) are located on the server - meaning not client - then you may need to change how you call those functions. Without seeing how you are attaching to the other server, it's difficult to say where you have gone awry, but look at the server issue first.

At this point, you are saying, "Give me a new server." However, you are not defining it and giving it meaning.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com