Results 1 to 1 of 1
Thread: Friendly methods
-
Friendly methods
If you do not specify access specifier while declaring a method, then the method is a friendly method. Friendly methods are accessible within the class they are declared and can also be accessed from the classes that are in the same package as the class that contains the friendly method.
Java Code:package Greek; class Alpha { void iamfriendly() { System.out.println("iamfriendly"); } } package Greek; class Beta { void accessMethod() { Alpha a = new Alpha(); a.iamfriendly(); // legal } }
Similar Threads
-
JSP methods example
By Java Tip in forum Java TipReplies: 0Last Post: 01-30-2008, 10:00 AM -
P~ 0.9 : Java-friendly scripting with powerful regex
By p7eregex in forum Java SoftwareReplies: 0Last Post: 12-17-2007, 08:10 PM -
methods
By Zensai in forum New To JavaReplies: 10Last Post: 12-03-2007, 05:31 AM -
Methods
By Java Tip in forum Java TipReplies: 0Last Post: 12-01-2007, 08:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks