Results 1 to 3 of 3
- 01-21-2010, 04:17 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 1
- Rep Power
- 0
Incompatible operand types int and double[][]
Hello
I just started java and try to do a programm wich is able to give me a fast solution of the Gaus System. (If anyone knows ;-) )
But I got a problem:
import java.util.Scanner;
public class Info {
/**
* @param args
*/
public static void main(String[] args) {
int a;
double b [][] = new double [4][4];
int c;
Scanner in = new Scanner(System.in);
System.out.println("Hello, first equation please:");
for(a=0 ; a< b.length ;a++){
System.out.println("Number:" + (a+1) + "");
if (a==b) Incompatible operand types int and double[][]
a= 0;
for(c=0; c<b.length;c++)
b [a][c] = in.nextDouble();
}
System.out.println("The first equation:");
System.out.println( b[0] +" x1 " +b[1]+" x2 "+ b[3]+ " x3 = " +b[3]);
}
}
If you are able to help me I would be verry happy :)
- 01-21-2010, 04:45 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Variable 'a' has type int and variable 'b' has type double[][]; how can you compare the two for equality? Answer: you can't and that's why the compiler is whining at you.
kind regards,
Jos
- 01-21-2010, 05:26 PM #3
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
Similar Threads
-
Incompatible types
By coltragon in forum New To JavaReplies: 5Last Post: 01-15-2010, 04:47 PM -
Code errors (incompatible types, cannot find variables, etc)
By Menre in forum Advanced JavaReplies: 7Last Post: 08-28-2009, 08:23 AM -
Incompatible types??? Counting through an array of Strings
By ookie833 in forum New To JavaReplies: 3Last Post: 12-14-2008, 01:52 PM -
'Incompatible operand' fault
By fatnic388 in forum New To JavaReplies: 3Last Post: 12-01-2007, 07:05 PM -
problem with scanner class:incompatible types
By fred in forum New To JavaReplies: 1Last Post: 07-20-2007, 07:02 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks