Accessing static members

Axel Dörfler axeld at pinc-software.de
Wed Jul 13 07:39:06 UTC 2016


Hi there,

I've tried something like the following code:
Java:

public abstract class A {
	public static final String STRING = "TEXT";
}

public class B extends A {
	public static final String ANOTHER = "TEST";
}

JavaScript:

function accessString(instanceOfB) {
	print(instanceOfB.STRING);
	print(instanceOfB.ANOTHER);
}

Expected output would be:
TEXT
TEST

Actual output is:
undefined
TEST

I guess this is a bug?

Bye,
    Axel.


More information about the nashorn-dev mailing list