日本語を表示するJSP
<%@page contentType="text/html; charset=Windows-31J"%> <!--pageディレクティブを利用してコンテンツタイプを指定--> <html> <head> <title>日本語を表示するJSP</title> </head> <body> <% String msg ="日本語を表示するJSP!"; out.print(msg); %> </body> </html>
FieldVariable
package jp.co.f1.basic.ch02; class Computer2{ String os; int memory; } public class FieldVariable { public static void main(String[] args) { Computer2 com = new Computer2(); com.os = "WinsdowsXP"; com.memory = 2048; System.out.println("パソコンのOSは「" + com.os +"」です。"); System.out.println("メモリサイズは「" + com.memory +"」です。"); } }
index.html
test
テスト