How to print an String variable as italicized text

前端 未结 2 1705
无人及你
无人及你 2021-01-21 03:29

I have the following statements inside my class:

String myName = \"Joe\";
System.out.println(\"My name is \" +myName);

I need the value on the

2条回答
  •  不思量自难忘°
    2021-01-21 04:03

    Here is an example of how to do that:

    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.io.IOException;
    
    
    public class Foo
    {
    public static void main(String[] args) throws IOException
    {
    PrintWriter out = new PrintWriter(new FileWriter("myFile.html"));
    out.println("my output");
    out.flush();
    out.close();
    }
    }
    

提交回复
热议问题