helloworld.jsc
来自「javascript的解释器」· JSC 代码 · 共 40 行
JSC
40 行
# language: javascript2
package akira.js2{
import js.lang.JObject;
import js.lang.System;
public class HelloWorld extends JObject
{
private var name = null;
private static var message = "Hello ";
//constructor
function HelloWorld(name)
{
this.name = name;
}
//getter and setter
public get Name()
{
return this.name;
}
public set Name(name)
{
this.name = name;
}
public function sayHello()
{
System.out.println(this.pickName() + HelloWorld.message + this.name);
}
private function pickName()
{
return (this.name +" ");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?