Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2004

Tip: Looking for answers? Try searching our database.

simple scope question

Thread view: 
nos - 04 Feb 2004 23:07 GMT
I have two files in the same directory which is '.'
I have a method in file1 that I invoke from a
method in file2. Why do I have to use
class1.method1() instead of just method1().
The class1.method1() is public. Neither file
has a package statement so the default
package is used.
Maverick - 04 Feb 2004 23:18 GMT
Cause you are calling a method on a different object...

>I have two files in the same directory which is '.'
>I have a method in file1 that I invoke from a
[quoted text clipped - 3 lines]
>has a package statement so the default
>package is used.
Luca Paganelli - 05 Feb 2004 15:11 GMT
Don't talk about files.

In JAVA you have classes.
JAVA chose to put different classes into different
files with extension .class but it's only an implementation
choice!

Now the problem is class scope and not file path scope!

Luca Paganelli

> I have two files in the same directory which is '.'
> I have a method in file1 that I invoke from a
[quoted text clipped - 3 lines]
> has a package statement so the default
> package is used.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.