David
David

Reputation: 282

Defining java classes without a name

I'm reading this research paper about a bug in an older JVM (Java 2 SDK 1.2). It declares a few classes like this

public class <Sup,L> {
    public int f = 1;
}

and this

public class <java.lang.String,L> {
    public int f = 1;
}

What does this syntax mean? Are these two classes called Sup and java.lang.String, are they generics, or is something else going on? Eclipse highlights the class decelerations with "Syntax error on tokens, InterfaceHeader expected instead."

Upvotes: 3

Views: 62

Answers (1)

Sharon Ben Asher
Sharon Ben Asher

Reputation: 14383

from a brief browsing of the document, I understood that this is a schematic representation of Class and classLoder. "schematic" means that class <Sup,L> is the format that the author chose to mean "Class Sup that was loaded by Class Loader L" this is not meant to be a JLS complient syntax.

Upvotes: 2

Related Questions