View Single Post
  #1 (permalink)  
Old 04-04-2008, 02:21 AM
vichet vichet is offline
Member
 
Join Date: Apr 2008
Posts: 1
vichet is on a distinguished road
why we use public access modifier?
I have a slight problem with my code below. I created a file and named it ClosedCurve.java and wrote all code into the file.

My code below wont be compiled. unless I add an access modifier public. and I do not understand why i need to do that.

PHP Code:
package classs.and.objects;

public interface 
ClosedCurve {
    
double computeArea();
}

class 
Triangle implements ClosedCurve {
    

    
double computeArea() // I need to change to public double computeArea()
    
{
        return 
0.0;
    }

Reply With Quote
Sponsored Links