Results 1 to 4 of 4
  1. #1
    MatthewTurner is offline Member
    Join Date
    May 2015
    Posts
    3
    Rep Power
    0

    Default The operator && is undefined for the argument type(s) boolean, int

    Hi, I am new to Java and currently studying to understand it better. Recently we were given homework
    to create a programme that reads student results using if.
    However, I am having problems I get this message in the console window:
    The operator && is undefined for the argument type(s) boolean, int

    I believe I am using int and whole numbers, I donīt understand what the problem is,
    be really grateful for any help!

    public class pedirNota {

    public static void main(String[] args) {

    double nota;
    nota = 8;

    if (nota> 0 && <5 ){
    System.out.println("insuficiente");
    }
    else if (nota == 5 ){
    System.out.println("suficiente");
    }
    else if (nota == 6 ){
    System.out.println("bien");

    }
    else if (nota >=7 && <=8){
    System.out.println("notable");
    }
    else if (nota>=9 && <=10){
    System.out.println("sobresaliente");
    }
    else {

    System.out.println("Furea de rango");
    }
    }

    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    27

    Default Re: The operator && is undefined for the argument type(s) boolean, int

    Java Code:
    nota>=9 && nota<=10
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: The operator && is undefined for the argument type(s) boolean, int

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    MatthewTurner is offline Member
    Join Date
    May 2015
    Posts
    3
    Rep Power
    0

    Default Re: The operator && is undefined for the argument type(s) boolean, int

    Great !! thanks a lot !

Similar Threads

  1. Replies: 6
    Last Post: 01-16-2014, 01:48 PM
  2. Replies: 4
    Last Post: 08-17-2013, 05:20 AM
  3. Replies: 5
    Last Post: 07-12-2013, 01:22 AM
  4. Replies: 3
    Last Post: 11-18-2011, 08:15 AM
  5. operator undefined for argument type int, String
    By aconti in forum New To Java
    Replies: 8
    Last Post: 05-30-2011, 07:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •