This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

private public questions  RSS feed

 
Jamess Davis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly does the private or public mean in java coding. I know it has to do with who or what can read the variable but would like a simple explanation if possible.

Oh and the Return function as well.

Thanks guys!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15860
80
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The 'public' and 'private' keywords are for access control of class members. You'll have to understand some object oriented programming concepts to understand what this means and what it's for.

See this in Sun's Java Tutorials:
Object-Oriented Programming Concepts
Controlling Access to Members of a Class

The 'return' keyword is used to return a value from a method.
See: Returning a Value from a Method
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!