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 / shaik baji

HI Vijay Kumar Khadia,

I have tried with your above posted code but it
doesn't work so kindly can you explain me more detailed.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a cup of java?

1010


How to write custom exception in java?

1046


Can a private method of a superclass be declared within a subclass?

1034


What do you mean by access modifier?

1024


Can a method be overloaded based on different return type but same argument type?

958


Explain the difference between an Interface and an Abstract class?

1169


Write a program to print the pattern given below

930


What is a flag value?

1016


What do you understand by classes in java?

1002


What is role of void keyword in declaring functions?

1046


What string is utf8?

991


State the difference between strings and arrays.

1236


What is the use of static methods?

1037


What type of value does sizeof return?

995


What is the purpose of the System class?

994