Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
29 views2 pages

Demo Java

dyfuyui

Uploaded by

prakash_net4_0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Demo Java

dyfuyui

Uploaded by

prakash_net4_0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

Scanner;

class test
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Hello what is your name?");
string a = keyboard.nextString();
string s="ok"+a+"how old r u";

Scanner keyboard1 = new Scanner(System.in);


string a = keyboard1.nextInt();
if (a <16)
{
System.out.println("you should not drive at this
moment ");

System.out.println("you should not vote at this


moment ");

System.out.println("you should not allow to rent


a car at this moment ");

}
else if (a <18)
{
System.out.println("you should not vote at this
moment ");

System.out.println("you should not allow to rent


a car at this moment ");

}
else if (a <25)
{
System.out.println("you should not allow to rent
a car at this moment ");

}
else if (25<=a)
{
System.out.println("you can do any thing this is
lega");

}
}
}

You might also like