Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #36081
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Martin Gregorie <martin@address-in-sig.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Help in codes please |
| Date | Sun, 11 Dec 2016 10:00:17 -0000 (UTC) |
| Organization | A noiseless patient Spider |
| Lines | 41 |
| Message-ID | <o2j83h$let$1@dont-email.me> (permalink) |
| References | <f1cf313a-a153-4865-92a0-def56b5147fc@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Sun, 11 Dec 2016 10:00:17 -0000 (UTC) |
| Injection-Info | mx02.eternal-september.org; posting-host="eb8acf614aac68ca34001b8669fb46bd"; logging-data="21981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yLJTBWoKCmR/Ubu9lGuS7hJzH1Pwi1v8=" |
| User-Agent | Pan/0.140 (Chocolate Salty Balls; GIT b8fc14e git.gnome.org/git/pan2) |
| Cancel-Lock | sha1:H7S9zxLOIFqLCGHQTMHkWYeZTFo= |
| Xref | csiph.com comp.lang.java.programmer:36081 |
Show key headers only | View raw
On Sat, 10 Dec 2016 16:27:39 -0800, kainattshafiq90 wrote: > Hi, can someone please help me code this??? > > Gadget class has four attributes, which correspond to the model, > > - The price (in pounds) > - The weight (in grams) > - The size (e.g. “71mm x 137mm x 9mm”) respectively > > > The price is a decimal number - The weight is an integer - The model and > the size are strings of text > > Each attribute is initialized in the constructor, by being assigned the > value of one of the constructor's four parameters, and each attribute > has a corresponding accessor method. > This looks like Java 101 homework. However, it seems that you've not made any attempt to help yourself yet, so: - Read your Java language manual. - Write code that you think should answer the problem. - Compile it. Test it. - If it doesn't work and you don't understand why, show us your code and ask again. Hints: Make sure you add a toString() method to your homework class so you can see whether its constructor did what you expect. Write a test program. This must have a main() method that creates an instance of your homework class, calls its toString() method and displays the result. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Help in codes please kainattshafiq90@gmail.com - 2016-12-10 16:27 -0800 Re: Help in codes please Martin Gregorie <martin@address-in-sig.invalid> - 2016-12-11 10:00 +0000 Help in codes please lewbloch@gmail.com - 2016-12-11 08:54 -0800
csiph-web