What kind of error it could be?

init:

deps-jar:

Compiling 1 source file to C:\Documents and Settings\2z7\StrokeFill\build\classes

C:\Documents and Settings\2z7\StrokeFill\src\ParseFile.java:82: incompatible types

found:int[]

required:int

return xy;

1 error

BUILD FAILED (total time: 0 seconds)

import java.io.*;

import java.util.List;

import java.util.ArrayList;

import java.util.LinkedList;

import java.util.ListIterator;

import java.util.regex.*;

import java.util.StringTokenizer;

publicclass ParseFile

{

private String Filename="newt3.newtmal.ps";

privateint x1, y1, x2, y2;// to plot lines from (x1,y1) to (x2,y2)

privateint xy[]=newint[205];

publicint setxy()

{

// parse a file to read line by line;

File file =new File(Filename);

try

{

BufferedReader br =new

BufferedReader(new FileReader(Filename));

String line;

String s1 ="0.5 setlinewidth 0.0 setgray";

String s2 ="stroke clear";

String s3 ="closepath fill";

String[] parts;

while ((line = br.readLine()) !=null )

{

if (line.equals(s1))

{

List<Integer> xList =new ArrayList<Integer>();

List<Integer> yList =new ArrayList<Integer>();

while ((line = br.readLine()) !=null && !line.equals(s2))

{

parts = line.split(" ");

xList.add(Integer.parseInt(parts[0]));

yList.add(Integer.parseInt(parts[1]));

}

Integer[] x = xList.toArray(new Integer[xList.size()]);

Integer[] y = yList.toArray(new Integer[yList.size()]);

// Plotting here using x and y arrays

int m = x.length;

for (int i = 0; i<m-1;i++)

{

xy[i]= x[i].intValue();

xy[i+m] = y[i].intValue();

// to return these values to class LinesRectsCirclesJPanel

}

// return xy;

}

elseif (line.split(" ").length == 8)

{

List><Integer> xList =new ArrayList<Integer>();

List<Integer> yList =new ArrayList<Integer>();

while ((line = br.readLine()) !=null && !line.equals(s2))

{

parts = line.split(" ");

xList.add(Integer.parseInt(parts[0]));

yList.add(Integer.parseInt(parts[1]));

}

Integer[] x = xList.toArray(new Integer[xList.size()]);

Integer[] y = yList.toArray(new Integer[yList.size()]);

// Plotting here using x and y arrays

int m = x.length;

xy[0]= Integer.parseInt(parts[5]);

xy[m+1] = Integer.parseInt(parts[6]);

for (int i = 0; i<m-1;i++)

{

xy[i+1]= x[i].intValue();

xy[i+m+1] = y[i].intValue();

// to return these values to class LinesRectsCirclesJPanel

}

}

}

}

catch (Exception exception){

exception.printStackTrace();

}

return xy;

}

}

>

[5587 byte] By [ardmorea] at [2007-11-27 8:47:16]
# 1
Do you know the difference between an array of int's and a single int?
prometheuzza at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 2
So you mean ?return xy[];
ardmorea at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 3
> So you mean ?> > return xy[];Ask your compiler.But do you know the difference between an array of int's and a single int?
prometheuzza at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 4
of course it's wrong, how correct?
ardmorea at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 5

> of course it's wrong, how correct?

Please just answer my question!!!

Again: do you know the difference between an array of int's and a single int?

And I know you copied the compiler error on the forum, but did you read it? If so, what did you not understand about it?

prometheuzza at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 6
I know, then what?
ardmorea at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 7
> I know, then what?Could you perhaps quote what you're answering to? And be a bit more explanatory?It looks like you don't want any help! One more silly reply from you, and I'm off. I have better things to do than pulling information out of you.
prometheuzza at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 8
> I know, then what?Perhaps a little background would help: http://en.wikipedia.org/wiki/Socratic_Method
BigDaddyLoveHandlesa at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 9
The compiler is complaining because you promised your method would return a single int, but instead you're trying to return an array of ints. So either change the method return type, or change the type of the returned variable.
Dick_Adamsa at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...
# 10

> The compiler is complaining because you promised your

> method would return a single int, but instead you're

> trying to return an array of ints. So either change

> the method return type, or change the type of the

> returned variable.

Is this in the form of a question?

BigDaddyLoveHandlesa at 2007-7-12 20:51:48 > top of Java-index,Java Essentials,New To Java...