A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide 1Z0-808
this week in the
private public questions
Joined: Sep 11, 2008
Sep 11, 2008 00:13:00
What exactly does the private or public mean in
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.
Jesper de Jong
Joined: Aug 16, 2005
Sep 11, 2008 00:52:00
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.
Returning a Value from a Method
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 8 API documentation
I agree. Here's the link:
subject: private public questions
Access Modifier Question
public private constructor
Using Other class
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015