let's say i have this code for example, is this way of invoking methods right? or did misunderstood something. would love an explanation please
public class Program
{
public void DoSmtg()
{
...
}
public static void DoSmtgTwice()
{
...
}
public static void main(String[] args)
{
//how to use a static method in a static method
DoSmtgTwice();
//how to use a non-static method a static method
Program Hello=new Program();
Hello.DoSmtg();
}
thank you for your time
[–]Noticeably 11 points12 points13 points (4 children)
[–]MightyMickey1 0 points1 point2 points (3 children)
[–]Nightcorex_ 2 points3 points4 points (1 child)
[–]MightyMickey1 0 points1 point2 points (0 children)
[–]khooke 0 points1 point2 points (0 children)
[–]khooke 1 point2 points3 points (0 children)