class test
{
private static void main(String []adsf)
{
}
}
explain me that the above code is error or exception
Answers were Sorted based on User's Feedback
Answer / bhargava
Code will throw exception. Because usually every stand
alone program execution should start with main method. It
should be public other wise this method doesnt exposed to
out side to run.
| Is This Answer Correct ? | 12 Yes | 0 No |
Answer / sri
It will not generate any compile time error, but while
running the program it will generate the output as "main
method is not public".....
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / xavier
This will throw a runtime error stating main method not public
This is because main method is the starting point of program
execution and it should be accessible by JVM
| Is This Answer Correct ? | 2 Yes | 0 No |
Is string a data type in java?
what is the use of finalize()Method please explain with an example
Can a class extends itself in java?
Can we instantiate Interfaces?
An inner class can actually be a subclass of the outer class? a. true b. false
Can we create our own daemon thread?
Which class contains a method: cloneable or object?
Explain access modifiers in java.
Can we able to pass objects as an arguments in java?
I need help please send me reply: Write a program "if given a string like 'HAT', the combination's returned should be like ATH,THA,TAH in java"?
Why packages are used?
What is the new line character?