Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
    Bookmark Topic Watch Topic
  • New Topic
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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown


Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
I need help on this java problem, can anyone please help me???:
"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){
//Your code here
Thank you....Vannie
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
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?
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
and thirdly, don't cross-post.

This is also in the "Java In General - Beginner's" forum. Where someone reminded you of High School.
Paper beats rock. Scissors beats tiny ad.
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic