View Single Post
Old 23-02-08, 02:20 PM   #4 (permalink)
kiran2710
Moderator
 
kiran2710's Avatar
 
Join Date: Jul 2006
Posts: 2,186
Thanks: 5
Thanked 402 Times in 275 Posts
Thanks: 5
Thanked 402 Times in 275 Posts
Rep Power: 62 kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute
Re: about access specifier

Classes Main and Demo will be in the default package.
Here the default package in the sense, its the folder where the java file will reside.
E.g. Here I placed the file in c:\demopack folder and compiled. As a result the classes will be stored in the demopack.
The scope\visibility of this classes will be in demopack.

class Demo
{
int a=5;
void print()
{
System.out.println(" a is: "+a);
}
}
class Main
{
public static void main(String args[])
{
Demo d=new Demo();
d.print();
}
}
__________________



Kiran







kiran2710 is offline   Reply With Quote