operator <= cannot be applied to int,java.lang.Object
807591May 24 2008 — edited May 24 2008Hi,
I am too tired of searching this topic every website. Finally, I decided to ask this forum. Pls help me.
Part of my code;
// may be some of these imports are not necessary.
import java.util.*;
import java.lang.*;
import java.io.*;
public class odev {
public static void main (String[] args) {
Scanner yaz = new Scanner(System.in);
System.out.println("How many person came?.");
int say = yaz.nextInt(); // In array first one is name 1 , second capacity 2 , third empty or full "b" {1, 2, "b"}
System.out.println("Which table?.");
int mas = yaz.nextInt();
Object [] [] masalar = {{1, 2, "b"}, {2, 4, "b"}, {3, 6, "b"}, {4, 4, "b"}, {5, 4, "b"}, {6, 2, "b"}, {7, 4, "b"}, {8, 6, "b"}, {9, 4, "b"}, {10, 2, "b"}};
if (((masalar [mas-1] [2]),equals ("b")) && (say <= (masalar [mas-1] [1]))) {masalar [mas-1] [2] = "d"}
// the error is in this part <= and error is operator <= cannot be applied to int,java.lang.Object
What can I do? Please help.