How can I add or use emojis in my java program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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