Can anyone please explain what is 'public' and 'private' in oop and specifically in java?
I am a bit confused.
kangkan_14
0
Newbie Poster
Recommended Answers
Jump to Postprivate methods can only be accessed by that class and not from another class.
public methods can be called from another class.
so you can have a public method being called which calls a private method.
you can have a private method call a public method.
…
Jump to PostIf you are researching scope of variables etc. It would also suit you well to understand static methods and variables.
http://download.oracle.com/javase/tutorial/java/javaOO/classvars.html
All 6 Replies
ajst
18
Junior Poster
kangkan_14
0
Newbie Poster
ajst
18
Junior Poster
Akill10
96
Posting Pro
jon.kiparsky
326
Posting Virtuoso
kangkan_14
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.