+4

can insert if statement on and how?

https://code.sololearn.com/cW5wM5ej7WWz/?ref=app

3/28/2020 9:28:30 PM

saidi bakari

6 Answers

New Answer

+2

Do you mean something like this? https://code.sololearn.com/c8JziRBTxT9c/?ref=app If you enter e.g. "saidi" it prints the name and the age. Edit: I think Царь СОБАКА - Догго l code seems to be what you are looking for

+4

what i want is that if will use the integer of 25 also to get an output "pitt"

+4

import java.util.HashMap; public class Program { public static void main(String[] args) { HashMap<String, Integer> Age = new HashMap<String, Integer>(); Age.put("saidi", 24); Age.put("bakari", 25); System.out.println(Age.get("saidi")); if(Age.get("bakari") == 25) { System.out.println("pitt"); } } } Is it what you want?

+3

example: public class MyClass{ public static void main(String[]args){ Hashmap<string, integer>Age = new Hashmap<string, integer>( ); age.put("saidi", 24) age.put("pitt", 25) System.out.println(get.age("saidi")) } }

+2

Hello saidi bakari Can you give an example? I am not sure what you want to do with an if statement.

+2

But can you describe what you want to do? Sorry, I still don't know why you need an if statement.