Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to find the given number is a prime number or not by getting input from the user

1094


Why singleton class is used in java?

1124


what is interface in java? Explain

963


What is instance synchronization?

1045


Why we use multi threading instead of multiprocessing?

1059


What technique is carried out to find out if a particular string is empty?

1012


When can you say a graph to be a tree?

1083


What is the use of a copy constructor?

986


What is http client in java?

1086


How do you sort in java?

977


How do you declare a destructor in java?

993


Which collection is ordered in java?

969


What is meant by oops concept in java?

988


Can a class be final?

936


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

953