
Write a Java application to print your name, ID, gender, and nationality..
the output will look like this :
my id is 0123456789 i am a man i am from thailand

Hi Friend,
Try the following code:
import java.util.*;
class Application
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.println("Enter ID: ");
int id=input.nextInt();
System.out.println("Enter Name: ");
String name=input.next();
System.out.println("Enter Gender: ");
String gender=input.next();
System.out.println("Enter Country: ");
String country=input.next();
String g="";
if(gender.equals("Male")||gender.equals("M")){
g="man";
}
else if(gender.equals("Female")||gender.equals("F")){
g="woman";
}
System.out.println("my id is "+id+" i am a "+g+" i am from "+country);
}
}
Thanks

thank you so much its work :)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.