Java Tutorial For Beginners 9 – Logical Operators in Java

Java

Video is ready, Click Here to View ×


Java logical operators
Searches related to Logical Operators in Java
logical operators in java examples
relational operators in java
use of logical operators in java
logical operators in java definition
logical operators in java meaning
use bitwise logical operators in java
different logical operators available in java
bitwise operators in java

46 thoughts on “Java Tutorial For Beginners 9 – Logical Operators in Java

  1. Put in everything exactly as in the video and zero output. I checked, and triple checked, and quadruple checked for any mistakes and there isn't any. Only thing is the interpreter doesn't recognize System.out.println() as there is no blue colored "out" in the code. Does anyone know how to solve this?

  2. Can also be done as

    package first;
    public class MyProgram{
    public static void main(String[] args) {
    int x=20, y=40;
    boolean A;
    if (x>10 && y>30) {
    A=true;
    }
    else {
    A=false;
    }
    System.out.println("the condition is " + A);
    }
    }

  3. package Lesson1;

    import java.util.Scanner;

    public class MyClass {
    static Scanner reader = new Scanner(System.in);
    public static void main(String[] args) {
    int note1,note2;
    System.out.println("Enter Note 1: ");
    note1=reader.nextInt();
    System.out.println("Enter Note 2: ");
    note2=reader.nextInt();
    // && Means: AND || Means: OR
    if ((note1 >=10) && (note2 >= 10)) {
    System.out.println("You have Succeeded ^^");
    }
    else {
    System.out.println("You Fucked Up -_-");
    }

    }

    }

  4. Omgggg thankss xD i watched some of tutorials and than next day i tried to do something simpe with all i learned anddd i did itt without errors or help ^^

  5. Just one question,it's really irritating me.I want to get output in such a way e.g if(Subject1>Subject2)
    Output=Subject1 is greater than Subject2
    .I just wanted the syntax..I couldnt do this with println or printf.Give me easy syntax.i'm beginner….

  6. public class MyClass

    public static void main (String []) args) }
    int subject1 = 30;
    int subject2 = 80;
    // && -> AND || -> OR
    if (subject 1 >=35) //|| (subject2 >= 35) {
    system.out.println("the condition is true");
    else {

    System.out.println ("the condition is false");
    }
    }
    }

  7. Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    Syntax error on token "||", invalid OnlySynchronized
    Syntax error, insert "}" to complete ClassBody

    at lesson1.MyClass.main(MyClass.java:9)

  8. Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    Syntax error on token "&&", invalid OnlySynchronized
    Syntax error, insert "}" to complete ClassBody

    at lesson1.MyClass.main(MyClass.java:9)

  9. Deeply appreciated. Speed is OK, not everybody speaks english here in you tube, so it is great that you took this in consideration. This curse is great and best of all is free (as in free beer). Keep on with the good work and just take the best of advices from comments. Best Regards !!

  10. public class My class {

    public static,void main (string []) {
    int subject1 = 20;
    int subject = 25;
    if ((subject >= 35) || (subject >= 35)) {
    System.out.print1n ("the condition is true");
    } else {
    System.out.print1n ("the condition is fales);
    }
    }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *