What’s the difference between public and private in java programming?

1 comment

in Programming & Design

asked:


What’s the difference between public and private in java programming?
Also,
what’s is the meaning of this: public int speed;

Thanks =)

Related posts:

  1. java programming? Nifer asked: What are the job prospectus for a friend...
  2. *****JAVA PROGRAMMING****? samk asked: Someone please please help me, here are instructions,...
  3. How to score good grade in Java programming? asked: I’m in my final year and really struggling...
  4. What is the best and latest java programming book? LytnN Scykes asked: Does anyone know the latest book and...

{ 1 comment }

jaffamol

Public means it is accessible to classes from outside itself.
Private means it is only accessible from within the class itself.

public int speed;

Would declare a public integer variable called speed.

Previous post:

Next post: