Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Ron McLeod
• Paul Clapham
• Bear Bibeault
• Junilu Lacar
Sheriffs:
• Jeanne Boyarsky
• Tim Cooke
• Henry Wong
Saloon Keepers:
• Tim Moores
• Stephan van Hulst
• Tim Holloway
• salvin francis
• Frits Walraven
Bartenders:
• Scott Selikoff
• Piet Souris
• Carey Brown

# HELP!

Greenhorn
Posts: 5
"Suppose we have this Point Class"
public class Point {
int X;
int Y;
Point(int w, int h){
X = w;
Y = h;
//finish this method that computes the distance
//between this Point and an x and y coordinat.
public double distance(int w, int h) {
//Your code here. Any suggestions anyone?
}
----------------------------------------------
Another problem related to the problem above:
"Create a method called distance that looks like this. This is part of the Point class"
public double distance(Point p){
}
Thank you....Vannie

Rancher
Posts: 13459
Vannie,
Firstly, it is good practice to be more descriptive in your subject titles. This helps us to help you, so it's in your own favour.
Secondly, this looks remarkably like homework. We don't like doing people's homework for them. Did you have a more specific question you'd like answered rather than "Please do my homework"?
eg Title: Distance in 2 dimensions
Given two points, (x1, y1) and (x2, y2), how do I find the distance between them?
thanks,
Dave

Ranch Hand
Posts: 3695
and thirdly, don't cross-post.

This is also in the "Java In General - Beginner's" forum. Where someone reminded you of High School.