which one is better to keep in my code among these 3What code? Anyway, the first in your list is a character entity. The second is a character. The third is a Unicode escape sequence.
i wonder why all below represent question markThe question mark is just a place holder. It tells us that the code can't figure what the encoding represent. It prints a ? in its place.
<!DOCTYPE html>
<html>
<body>
à é ě ł ź ś č š
</body>
</html>
In the browser, it outputs import java.awt.*;
import javax.swing.*;
public class T {
public static void main(String args[]) {
JFrame frame = new JFrame("Testing Unicode");
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JLabel label = new JLabel("\u00E0 \u00E9 \u011B \u0142 \u017A \u015B \u010D \u0161");
label.setFont(new Font("Serif", Font.PLAIN, 28));
panel.add(label);
frame.add(panel);
frame.setSize(500, 300);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
It prints the same string of characters à é ě ł ź ś č š in the JLabel.
I couldn't display the same thing on the command line(maybe an expert will show us how to do that).
what is difference between above 3 formats