Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
1

whats the difference between public static void and private static void in java

MatthewXia
MatthewXia

i have no idea........................................................................................really...................................................................................idk why.................................................................................but i actully dont know.....................................................i shud tho....................................................why.................................................................and..........................................................wut..........................................................am..........................................................i..........................................................doing..........................................................with..........................................................my..........................................................life?

2 years ago
You are viewing a single comment. View All
1
Coder100
Coder100
class Something { public a() { } private b() { } } Something c = new Something(); c.a(); // public so you can call it c.b(); // ERROR is private so you can't
2 years ago