Re: Writing a method [beginner]



On Mar 20, 3:35 am, Mark Vismonte <LiLrUnNiNBaL...@xxxxxxxxx> wrote:
or say you wanted something to print out

public void printThis(String z)
{
System.out.println(z);

}

On Mar 20, 12:31 am, Mark Vismonte <LiLrUnNiNBaL...@xxxxxxxxx> wrote:

those would be the parameters say if you wanted a method called addOne

public static int addOne(int firstNumber)
{
return firstNumber + 1;

}

On Mar 19, 11:02 pm, KyoGaSuki <jrockgadaisukida...@xxxxxxxxxxx>
wrote:

So we have a test tomorrow on writing methods, and I thought I
understood it...until I looked at some examples and realized....I
don't know how to actually write one.

So far I know:

public static void methodName( // Don't know what goes here and
why // ) {
statements here;

}

Can anyone help T.T?

So when it says "the method getCoord takes one string parameter, does
that mean is should be:

public static string getCoords

and then it says "prompt for and performs input of one floating point
value representing a coordinate of a point" does it mean that it would
be?:

public static string getCoords(float coord){

}
.



Relevant Pages

  • Re: Writing a method [beginner]
    ... return firstNumber + 1; ... public static string getCoords ... public static string getCoords{ ... Use JOptionPane.showInputDialogfor a GUI input dialog ...
    (comp.lang.java.programmer)
  • im still here ...
    ... public void paintComponent{ ... public static String setAlarm(String theAlarm,String theTime){ ...
    (comp.lang.java.help)
  • Re: JTable help
    ... interActiveJatable and the resultObject: ... public void setClassCode{ ... public static final int CLASS_INDEX = 1; ...
    (comp.lang.java.help)
  • Re: top-post...
    ... > public void keyPressed ... > public static String reverse(String s, ... > String s, boolean lines, boolean letters) ...
    (comp.lang.java.programmer)
  • RE: Object Name
    ... An unhandled exception of type 'System.NullReferenceException' occurred in System.Windows.Forms.dll ... public static string GetControlName ... >> It seam there is no name properties. ... >> public void SetDataInputField ...
    (microsoft.public.pocketpc.developer)