can we write a program with out a class in core java?
Answers were Sorted based on User's Feedback
Answer / venkat kanneganti
yes,an empty source file is compiled with out error,but it
will throw Runtime Exception when jvm will not find Main()
method.
| Is This Answer Correct ? | 18 Yes | 2 No |
Answer / navneet raushan
Yes, with the help of static block we can write a program.
static block executed first always
| Is This Answer Correct ? | 12 Yes | 5 No |
Answer / saran
it is possible to create java program without userdefined class.
public enum AAA {
AAA;
public static void main(final String[] args) {
System.out.println("H");
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / juned
yes,It is possible by using enum(which is a predefine class)
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / subrat
ya we can do it by using enum,but it is also a predefined class.
public subrat
{
subrat;
public static void main(String k[])
{
System.out.println("SUBRAT");
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
I don’t want my class to be inherited by any other class. What should I do?
How to excute - Interface - Inner class- method can any one tell how to execute/ call this main method public interface abc { static int i=0; void dd(); class a1 { a1() { int j; System.out.println("inside"); }; public static void main(String a1[]) { System.out.println("in interfia"); } } }
What is class and its types?
what is bmg file and how to create that files?what will it contailn?
0 Answers HCL, Probe Services,
What do you mean by Function Overloading in java?
Add a value x to array from index l to r where 0 <= l <= r <= n-1
What is qualitative variable?
Why should we use singleton pattern instead of static class?
What is a Java switch statement, and how can it be used?
Can I have constructor in Interface?
why not override thread to make a runnable? : Java thread
What is complexity and its types?