i have this question
static class A {
void process() throws Exception { throw new Exception(); }
}
static class B extends A {
void process() { System.out.println("B"); }
}
public static void main(
String[] args) {
new B().process();
}
Options :
A. B
B. runs but no output
rest of the options are Compilations Errors
Answer is A
i have no problem with the answer
but this code raised a few questions for me
can classes be static??? according to the code yes but when and under what conditions???
and how am i supposed to use new with something that is static???