我需要将欧元或英镑符号分配给变量。我怎样才能做到这一点?

String euro = "";// What i have to write here??
System.out.println(euro);// I need to print euro symbol

最佳答案

public class ExampleEuroPound {

    public static void main(String args[]){

        String euro = "\u20ac";
        String pound = "\u00a3";

        System.out.println("pound = " + pound);
        System.out.println("euro = " + euro);
    }
}

10-06 13:18