Is it possible to write JAVA program without including any
of the packages,such as "import java.io.*";
bcoz I instantly wrote a code without "import..." statement
and runned the program on command Line & it worked.
the code is:
class Person
{
String name;
int age;
Person(String s,int a)
{
name = s;
age = a;
}
accept()
{
System.out.println(name+"Hi!!!!!");
System.out.println(age);
}
}
class Demo
{
public static void main(Strings args[])throws
IOException
{
String name = args[0];
int age = Integer.parseInt(args[1]);
Person p = new Person(name,age);
p.accept();
}
}
Answer Posted / anandkumar
No its not Possible. but if you are not using the Exception it will be possible.....
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are the supported platforms by java programming language?
What happens if we override private method?
What is thread pool in java with example?
What is sortedmap interface?
List some important characteristics on jre
Tell some latest versions in JAVA related areas?
What is sorting algorithm in java?
Is 0 a prime number?
What is variable explain with example?
Explain the scope of a variable.
What is time complexity java?
What class of exceptions are generated by the java run-time system?
What is treemap in java?
How do you sort arrays in java?
Explain hashset and its features?