wood burning stoves
The moose likes Beginning Java and the fly likes Methods & Arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Methods & Arguments" Watch "Methods & Arguments" New topic

Methods & Arguments

Bryan Snipes

Joined: May 09, 2008
Posts: 4
Hello everyone... I am just beginning to learn Java thru online courses. My first question (of many!) is what is the (Shirt s) in the code below? I understand that this method is accepting parameters from another class. But I don't understand what the "Shirt" is... the course said the "s" is the parameter.

Richard Chambers
Ranch Hand

Joined: Apr 03, 2008
Posts: 40
Shirt is the type of "s"

If you program is dealing with a closet,
you'd have Shirts, Pants, Coats, etc...

"s" in this case would be how many of the type.

Hope this helps,

btw, I'm struggling to finish my first semester JAVA class too,
so others will have more clarification or correction for me I'm sure.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46405
Welcome to the Ranch.

Not quite, Richard.
You are correct that the type of the parameter is Shirt, but the "s" is what you are calling it in the method you are writing. The official term is the identifier for that parameter.
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
not only is Shirt a type,
it's very likely a class,
and will very likely be defined in another file,
very likely called Shirt.java,
with some code similar to

Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15093

"j Rookie", please check your private messages. You can see them by clicking My Private Messages.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link: http://aspose.com/file-tools
subject: Methods & Arguments
jQuery in Action, 3rd edition