Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  ee.java
Language: JAVA
Code:
 class Patrat
 {
    private int latura ;
     
     public Patrat(int l)
     {
         latura=l;
     }
    public Patrat()
     {
       latura=10;
      }        
     public String toString()
    {
      return "Patrat: "+latura+" Aria: "+(latura*latura) ;
    }
}
class Exe
{
   public static void main(String[] argv)
   {
      Patrat p1,p2;
       p1=new Patrat();
       p2=new Patrat(3);
       System.out.println(p1);
       System.out.println(p2);
     }
}     
     
             
Comments: