• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Methods & Arguments

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"j Rookie", please check your private messages. You can see them by clicking My Private Messages.
 
reply
    Bookmark Topic Watch Topic
  • New Topic