I tried to insert the simplest java code on the page of my site . That's what I did ! It's empty there! I tried to do this with the <applet> tag. Here is the code:

<applet code=" class OneMoreHello { public static void main(String[] args) { byte age=12; char sex='м'; double weight=41.2; int height=145; System.out.println("Персональные данные пользователя:"); System.out.println("Возраст: "+age+" лет"); System.out.println("Пол(м/ж): "+sex+"."); System.out.println("Вес: "+weight+" кг"); System.out.println("Рост: "+height+" см"); } } " > 

How to do right?

  • 2
    You first learn to distinguish JavaScript from Java - Barmaley

1 answer 1

Here it says that the attribute:

code: URL - Specifies the file name of a Java applet

codebase: URL - Specifies a relative base URL for applets

Those. To work as an applet, you need to create the applet itself, compile it in Java, receive your_app.class file and specify the path to it in code .