Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.SimpleBindings;
import javax.script.SimpleScriptContext;

public class Main {
    public static void main(String[] args) throws Exception {
        ScriptContext ctx = new SimpleScriptContext();
        Bindings globalBindings = new SimpleBindings();
        ctx.setBindings(globalBindings, ScriptContext.GLOBAL_SCOPE);
        ctx.setAttribute("year", 2015, ScriptContext.GLOBAL_SCOPE);
        ctx.setAttribute("name", "Java", ScriptContext.GLOBAL_SCOPE);
    }
}