+ 3

How can I add or use emojis in my java program?

I'm a beginner in java, and i want to make a program which returns an emoji when the user types the text version of it. When I use string for emojis, it says "no output". For example: If the input is ":D" then the expected output is "😀". Here's the code: import java.util.*; public class Emojis{ public static void main(String [] args){ String emoji = "😀"; Scanner obj1 = new Scanner(System.in); String in = obj1.next(); if (in == ":D"){ System.out.println(emoji); } } } Please let me know if there are any mistakes in my code😊

26th Aug 2020, 10:05 AM
Kanishk Desai
Kanishk Desai - avatar
3 odpowiedzi
+ 2
Thank you😊
26th Aug 2020, 1:40 PM
Kanishk Desai
Kanishk Desai - avatar
0
Search for emoji Unicode
26th Aug 2020, 10:24 AM
Kry$tof
0
hsg^÷_
26th Aug 2020, 6:21 PM
Rajat Kumar
Rajat Kumar - avatar