0
Hashing
I am supposed to take the condition in the if statement ( if(counts.containsKey(name)) ) and use ONLY a conditional operator. https://code.sololearn.com/cIXr55XI73wH/#java
5 Respostas
+ 4
Hello Fare Jare
Please don't put your code link in the tags. Now is not possible to click on the link.
Tags makes a question searchable. So you could use hashing and java. And if you click on a tag it will show questions which also uses this tag.
Thank you very much :)
+ 2
https://code.sololearn.com/cIXr55XI73wH/?ref=app
The link from the website does not work
Can you please explain more about your task? I am not sure if I understand your question.
+ 2
Fare Jare
The code playground does not support packages.
remove this: package hashingex;
The code works.
+ 1
I think I got it now:
conditional operator is also called ternary operator.
(1) condition ? (2) true : (3) false
if (1) is true (2) will be executed. Else (3) will be executed.
For example:
int max = 0;
int a = 3;
int b = 4;
if(a > b) {
max = a;
}else{
max = b;
}
In short:
max = a > b ? a : b
Here is a tutorial about it:
tutorials.jenkov.com/java/ternary-operator.html
0
I am supposed to rewrite the code within the add method using a conditional operator.