Hashing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

5th May 2020, 10:10 PM
Fare Jare
Fare Jare - avatar
5 Answers
+ 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 :)
5th May 2020, 10:29 PM
Denise Roßberg
Denise Roßberg - avatar
+ 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.
5th May 2020, 11:01 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Fare Jare The code playground does not support packages. remove this: package hashingex; The code works.
5th May 2020, 11:05 PM
Denise Roßberg
Denise Roßberg - avatar
+ 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
5th May 2020, 11:30 PM
Denise Roßberg
Denise Roßberg - avatar
0
I am supposed to rewrite the code within the add method using a conditional operator.
5th May 2020, 11:14 PM
Fare Jare
Fare Jare - avatar