Logo 
Search:

Java Article

Submit Article
Comments on Program to show the use of Conditional AND Operator (&&) in If Statements
Category: Java (Homework Help)    Author: Easy Tutor

A Java Program to show the use of Conditional AND Operator (&&) in If Statements.


Joel Gaitan
Joel Gaitan from JapanNov 28
this was truly helpful through a bit hard to follow
Joel Gaitan
Joel Gaitan from JapanNov 28
//simple code for usig && and ||
import java.util.Scanner;
class JAVA_01
{
public static void main(String args[])
{
Scanner no = new Scanner(System.in);
int age;
System.out.println("enter your age ");
age = no.nextInt();
if (age<=5 && age >10)
{
System.out.println("your not allowed in this room");

}
}
}


Please enter your Comment
  • Comment should be atleast 15 Characters.
  • Please put code inside [Code] your code [/Code].