011.
a.
b.
012.
a.
b.
c.
d.
e.
CHAPTER
02
Java Basics
What are the possible ways of declaring the Java main
method?
Answer:
Following are the possible ways
of declaring the Java main
method.
public static void main (String argument [])
static public void main (String argument [])
So, while declaring the Java main method,
the order of the public,
static, void keyword does not matter,
they can be written in any
order.
What are the possible ways of declaring a Java class?
Answer:
Following are the possible ways of declaring a Java class:
public class Class1 {}
class Class2 {}
private class Class3 {}
protected class Class4 {}
static class Class5{}
Approach a declares a class as public.
Approach b does not
use any access specifier, so it has default access. It will be
accessible only within the package.
Approaches c and d use the