[HD-OCP17/21-Fundamentals Pg 0, Sec. 6.5.2 - accessing-static-members]
Posted: Sun Nov 03, 2024 6:44 am
Code: Select all
class TestClass{
public static void main(String[] args){
ConnectionHelper c = null;
c.ping();
}
}
But ping() method is private:That's right. It will compile and run fine (of course, without any output).
Code: Select all
class ConnectionHelper{
static int idle_timeout;
static String url;
private static void ping(){ } //order of modifiers doesn't matter
static public final void check(){ } //order of modifiers doesn't matter
}
BR,
João Carvalho Lopes