Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet argument?

 
Jeremy Parsons
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the following code, what is the "gr" in the Graphics argument? Could that "gr" be anything I want to call it, or is "gr" something reserved in java?

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"gr" is the (completely arbitrary) parameter name. Inside the method, it's the name of a variable that points to a Graphics object. You could substitute any legal Java variable name.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic