3

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."

1
  • 2
    "Are they generics?" No. Generics didn't get added to the language until Java 5.0 in September 2004, and Java 1.2 was released in December 1998. Commented Mar 17, 2019 at 20:38

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.