Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

private public questions

 
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
Saloon Keeper
Posts: 15485
43
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic