PDA

View Full Version : JAVA bug "Point is already defined in this compilation unit"


nagaya
03-04-2009, 08:25 PM
machanla adath error ekak

import java.awt.Point;

class Point
{
public static void main(String[] args)
{
Point location = new Point(4,13);
System.out.println("X: " + location.x);
System.out.println("Y: " + location.y);
location.y = 6;
location.x = 7;
System.out.println("X: " + location.x);
System.out.println("Y: " + location.y);
}
}

mehema liwwama enawa

H:\java>javac point.java
point.java:1: Point is already defined in this compilation unit
import java.awt.Point;

kiyala

but;import kaalla ain karama wada karanneth ne;mehema liwwama wada

class Point
{
public static void main(String[] args)
{
java.awt.Point location = new java.awt.Point(4,13);
System.out.println("X: " + location.x);
System.out.println("Y: " + location.y);
location.y = 6;
location.x = 7;
System.out.println("X: " + location.x);
System.out.println("Y: " + location.y);
}
}

Compiler ekatada aul ? matada aul ?
i use JDK6u10

thnx :D

zanharjabir
03-04-2009, 08:27 PM
owaa apita threney nahaa bang

chimpa
03-04-2009, 08:38 PM
Machan it seems like you name your class with the same name that your are going to import. That means you have used 'Point' for your class. Try to change the class name to something else.
But as I feel the compiler should identify the relavant scopes and get the correct classes.
Seems there also bug reported some time back. Dont knw if that is corrected in the new versions. Just google and see.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4366290

nagaya
03-04-2009, 08:39 PM
any help?

nagaya
03-04-2009, 08:40 PM
Machan it seems like you name your class with the same name that your are going to import. That means you have used 'Point' for your class. Try to change the class name to something else.
But as I feel the compiler should identify the relavant scopes and get the correct classes.
Seems there also bug reported some time back. Dont knw if that is corrected in the new versions. Just google and see.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4366290
thnx a lt machan...it didn't notice it...i'm a fool ban...but new thing to remember....thanx a lt machan

lankanatha
03-04-2009, 08:41 PM
Machan it seems like you name your class with the same name that your are going to import. That means you have used 'Point' for your class. Try to change the class name to something else.
But as I feel the compiler should identify the relavant scopes and get the correct classes.
Seems there also bug reported some time back. Dont knw if that is corrected in the new versions. Just google and see.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4366290

ELA KOLLEK NE