我是Java新手,无法弄清楚如何格式化我的代码: 字体“Courier New”字体大小“9”粗体
我正在尝试格式化整个段落的文本。我真的很感激帮助。提前谢谢!
以下是我的代码:
public class H_1
{
//--------------------------------------------------------------------
// main
//--------------------------------------------------------------------
public static void main (String[] args)
{
Graphics
// Declare variables
// int someInt;
// double someReal;
// String someString;
Scanner keyboard = new Scanner(System.in); // Connect to keyboard
// Show application header
System.out.println("Welcome to my Application!");
System.out.println("--------------------------\n");
// Display output
System.out.println("I'm singing in the rain");
System.out.println("Just singing in the rain");
System.out.println("What a glorious feelin'");
System.out.println("I'm happy again \n");
System.out.println("I'm laughing at clouds");
System.out.println("So dark up above");
System.out.println("The sun's in my heart");
System.out.println("And I'm ready for love \n");
System.out.println("I walk down the lane");
System.out.println("With a happy refrain");
System.out.println("Just singin',");
System.out.println("Singin' in the rain");
// keyboard.nextInt() reads token from keyboard and converts to whole number
// keyboard.nextDouble() reads token from keyboard and converts to real number
// keyboard.next() reads token from keyboard
// keyboard.nextLine() reads line from keyboard through end-of-line character
// Close keyboard
keyboard.close();
// Show application close
System.out.println("\nEnd of my Application");
}
}
答案 0 :(得分:1)
您的问题尚不清楚,但由于没有太多选项可供回答,让我们走吧:
编辑;当你专注于"打印出来":你的代码正在写入控制台。这意味着您的选项中limited。所以:咨询该链接,看看是否有帮助。
最后:如果这是为您的作业创建纸质打印 - 请考虑将您的Java程序的输出复制到您最喜欢的" office"程序在打印之前将其格式化。