'void' type not allowed here error (java) help?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-14T15:45:23Z Indexed on 2010/03/14 15:55 UTC
Read the original article Hit count: 252

Filed under:
|
|

When i try to compile this:

import java.awt.* ;

    class obj
    {
        public static void printPoint (Point p) 
        { 
            System.out.println ("(" + p.x + ", " + p.y + ")"); 
        }
        public static void main (String[]arg)
        {
            Point blank = new Point (3,4) ; 
            System.out.println (printPoint (blank)) ;
        }
    }

i get this error:

obj.java:12: 'void' type not allowed here
        System.out.println (printPoint (blank)) ; 
                                               ^
1 error

I don't really know how to start asking about this other than to ask:

  • What went wrong here?
  • What does this error message mean?

© Stack Overflow or respective owner

Related posts about java

Related posts about error