public class Home
{
int a;
int b;
public static void main(String[] args)
{
System.out.print("1");
}
public static double pi()
{
return 3.14;
}
}
Can anyone explain me how this code works? Thank you in advance!!!
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Nouser
19 September 2020, 13:51
int a;
int b;
two instance variables, never used
public static void main(String[] args)
the main method, here the code starts to execute
System.out.print("1");
and prints 1
public static double pi()
a method that is never used
public class Home
this all has to be in a class
0