Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #36168

Re: can someone chk is this code ok and if i can make it better please state how

Newsgroups comp.lang.java.programmer
Date 2017-01-06 17:23 -0800
References <e69219b6-6d90-4d99-9e0c-485e867fded4@googlegroups.com>
Message-ID <e7506c40-ea1f-4008-93e8-e8ca807b5cdc@googlegroups.com> (permalink)
Subject Re: can someone chk is this code ok and if i can make it better please state how
From lewbloch@gmail.com

Show all headers | View raw


On Friday, January 6, 2017 SuperGiirl wrote:
> public class Gadget
> {
>     private int Weight;
>     private double Price;
>     private String Model;
>     private String Size; 
> 
>     
>     public Gadget(int theWeight, double thePrice, String theModel, String theSize)
>     {
>       Weight = theWeight;
>       Price = thePrice;
>       Model = theModel;
>       Size = theSize;
>     }
> 
>     
>     public int getTheWeight()
>     {
>         
>         return Weight;
>     }
>     public double getThePrice()
>     {
>         return Price;
>     }
>     public String getTheModel()
>     {
>         return Model;
>     }
>     public String getTheSize()
>     {
>         return Size;
>     }

In addition to the excellent advice others have offered, look into providing Javadoc comments, the ones that begin with `/**` (slash-star-star) and precede public and protected declarations such as your method declarations. You can find out all about Javadoc comments and the documentation they generate using `javadoc` in the Oracle Java documentation.

-- 
Lew

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

can someone chk is this code ok and if i can make it better please state how SuperGiirl <kainattshafiq90@gmail.com> - 2017-01-06 12:38 -0800
  Re: can someone chk is this code ok and if i can make it better please state how SuperGiirl <kainattshafiq90@gmail.com> - 2017-01-06 12:52 -0800
    Re: can someone chk is this code ok and if i can make it better please state how Andreas Leitgeb <avl@logic.at> - 2017-01-06 21:11 +0000
      Re: can someone chk is this code ok and if i can make it better please state how SuperGiirl <kainattshafiq90@gmail.com> - 2017-01-06 14:02 -0800
  Re: can someone chk is this code ok and if i can make it better please state how Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-01-06 16:15 -0500
    Re: can someone chk is this code ok and if i can make it better please state how Robert Klemme <shortcutter@googlemail.com> - 2017-01-07 14:16 +0100
  Re: can someone chk is this code ok and if i can make it better please state how lewbloch@gmail.com - 2017-01-06 17:23 -0800
  Re: can someone chk is this code ok and if i can make it better please state how Robert Klemme <shortcutter@googlemail.com> - 2017-01-07 14:23 +0100
  Re: can someone chk is this code ok and if i can make it better please state how galt_57@hotmail.com - 2017-01-07 11:39 -0800

csiph-web