Importing packages
,simply include import command in the program you want to import, that`s all you can use all those features in the package.Not clear!
Lets see an example it will be cleared..(am giving very simple programs as example so that it will be cleared)
example:
import Mypack1.*; //see from where this Mypack1 came.
class Package extends Pack //here Pack is name of class I used in Mypack1
{
public static void main(String s[])
{
Pack p=new Pack(); //here creating object for that class
int k=90;
p.show(); //access it through dot operator
}
}
Compile it and run the program you can see those Mypack1 features in this file.
Don`t know how to compile and run,no probs see here.
Hurray! now u can develop ur own package.
See a mouse ROBOT here (moves your mouse pointer automatically).
No comments:
Post a Comment