As i said here is certain changes to your queries
1)methodUser.nonStaticMethod();.............. works fine.
2)methodUser.staticMethod();...............you can simply call as...
Type: Posts; User: rohan22
As i said here is certain changes to your queries
1)methodUser.nonStaticMethod();.............. works fine.
2)methodUser.staticMethod();...............you can simply call as...
If you want a particular method of a class (w.r.t its access specifiers) to be called, without creating an object of that class we usually make it as static.
But on the other hand if you want a...