• Post Reply 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Default how i can do this in java main and class point

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
write a class named Point that include two integer fields x and y and the following methods...
1. a constructor with no parameters that set both x=y=0
2. a constructor with one parameter a that sets x=y=a
3. a constructor with two parameters a,b that sets x=a and y=b
4. two get methods to return x and y
5. two set methods to set a new values to x and y
6. getLocation method which return a string of the location of the point

after that build a main method in which great three points from the three different constructors and print out its x-y values and location


please any one help me i need this program use netbeans
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help? Sure, what have you come up with so far?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch!

We're more than happy to help, but we ask that people ShowSomeEffort first, particularly when it's an assignment. Thanks!
 
Marshal
Posts: 67344
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
""ssssami ssssamy",", please check your private messages for an important administrative matter. Thanks.
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Already answered in cross-post: http://www.java-forums.org/new-java/32784-how-i-can-do-java-main-class-point.html

OP, please read: BeForthrightWhenCrossPostingToOtherSites in the FAQ's.
 
Attractive, successful people love this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!