Interviews2 answers
if there is a class A in which main class is defined,and there is another class B which extends the class A.now if I save the file as B.java, then is that programme run or not?
2 Answers
YES
Praveen DhatrikaPosted Jan 22, 2016, 9:48 AM EST
yes it can but the thing is you must not to give class A is public modifier because file can save with the name of public class only after compilation it will will two files for each class A and class B and class B must be declared as public
satyanand kumarPosted Feb 14, 2008, 2:41 AM EST
