class A{
class B{
}
}
in which name u save the file,its the program compile?

Answers were Sorted based on User's Feedback



class A{ class B{ } } in which name u save the file,its the program compile?..

Answer / vipul

We can save the program by any name either A or B,

Program will compile but will not run......

Is This Answer Correct ?    8 Yes 0 No

class A{ class B{ } } in which name u save the file,its the program compile?..

Answer / jasbir yadav

We can save the file as A.java

Is This Answer Correct ?    5 Yes 1 No

class A{ class B{ } } in which name u save the file,its the program compile?..

Answer / neelanand

Since the program is compiled, we can save it with any
filename with .java extension eg. abc.java

but if you want to use it into other program we must save
it with the A.java

Is This Answer Correct ?    4 Yes 2 No

class A{ class B{ } } in which name u save the file,its the program compile?..

Answer / amulkumar

We can save the file using any name;
A.java or B.java

Is This Answer Correct ?    3 Yes 3 No

class A{ class B{ } } in which name u save the file,its the program compile?..

Answer / venkat

We can sava it as any class name in it. But it will not
compiled
inorder to the without of mainclass.

Is This Answer Correct ?    1 Yes 2 No

class A{ class B{ } } in which name u save the file,its the program compile?..

Answer / kalpana

output
-------

Inner classes cannot have static declarations

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More Core Java Interview Questions

how to compile jsp?

4 Answers   Logica CMG,


Can arraylist hold different types java?

0 Answers  


Can we override private methods?

0 Answers  


Differentiate between nested and inner class in java.

0 Answers   Akamai Technologies,


Hi friends i want display Triangle shap stars(*) please can tell me any one java code logic? * *** ***** ******* Like this

2 Answers   NIIT, TCS,






what do you mean by java annotations?

0 Answers  


Which is faster string or stringbuilder?

0 Answers  


How do you override a method in java?

0 Answers  


Tell me are there implementations for sorting and searching in the java libarary?

0 Answers  


What are the types of inner classes (non-static nested class) used in java?

0 Answers  


Can we have more than one package statement in source file ?

0 Answers  


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

0 Answers  


Categories