Hi parased jedhe :)
I knows that constructor doesn't return. Thus, you delete the "void"
keyword.
Enjoy! :)

On Feb 2, 4:00 pm, prasad jedhe <[email protected]> wrote:
> >> i have written this code & am getting an error at line 5 as *"cannot find
>
> symbol ;symbol :constructor point(int,int )"*
>
> public class Main                                //line 1
> {                                                        //line 2
>     public static void main(String[] args) //line 3
>     {                                                   //line 4
>       point p1 = new point(5,6);             //line 5<< giving error at this
> line
>       p1.print();
>     }
>
> }
>
> class point
> {
>     private int x=0;
>     private int y=0;
> void point(int a,int b)
>     {
>
>         this.x=a;
>         this.y=b;
>     }
>     void print()
>     {
>         System.out.println("Value of x: "+x+ " Value of y:"+y);
>         System.out.println("-------------------------------");
>     }
>
> }
>
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to