Java tutorial in Hindi for beginners #20 Control statement with user input in java

preview_player
Показать описание
Here we learn about how to use if else with user input in java from the command line in java and what is nested conditions in java tutorials for beginners in the Hindi language. This is a step-by-step guide to java.

Points of video
Import Scanner class.
Write Condition with input value
Small Question for you?

java tutorial for beginners step by step
Playlist Link

Рекомендации по теме
Комментарии
Автор

Please support me by subscribe, like and comment :) thank you 🤗

Java tutorial playlist in Hindi Playlist Link:

codestepbystep
Автор

Nhi ho rha sir 20part k end main jo ex.di thi if else if wali

HrmnprtSingh
Автор

If else if i think we can use like if age= 18 && age== 20

Lordlucifer
Автор

Here is example for 'If else if' condition:

package praticetest;

import java.util.Scanner;
public class ConditionWithInput {
public static void main(String[] args) {
//Input the value through scanner class
System.out.println("Enter your Age & Gender :");
try (Scanner input = new Scanner(System.in))
{
//Declare variable to get input through command line
int age = input.nextInt();
//Add If else If condition
if(age == 18) {
System.out.println("You are allowed.");
}else if (age > 18)
{
System.out.println("You are fully eligible.");
}else
{
System.out.println("You are not allowed.");
}
}

dhairyashukla
Автор

how to take gender from User if age is >=18 for given discount on Bill.

diwanprateek