Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5950443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:23:39+00:00 2026-05-22T17:23:39+00:00

After taking a look in the Java VM specification , I noticed that a

  • 0

After taking a look in the Java VM specification, I noticed that a lot more than just ASCII letters could be used to create an identifier.

Firstly, I was wondering if there were any extra symbols (apart from $, that are available for identifiers)

Do you think it would be possible, with the extended character set to encode additional information in an identifier, and a custom classloader, to implement true Java generics?

Of course, you would have to get around type erasure, but that could be possible with a custom parser?

So you could store generic names in a format like: $g$GenericList$_Java_lang_String$

I’m using GenericList here as I don’t intend to modify the original implementation!

Load them in with the class loader, create a proper GenericList<String> version and send it back.

EDIT: I plan to use this for a language I’m building on the JVM. As it uses $‘s and _‘s as special characters, encoding information like that might just work!

EDIT 2: I suppose the more difficult thing to do would be generic methods? Does anyone have any information on how those would be implemented?

EDIT 3: Since classes can only be unloaded when the classloader disappears, would I be able to cache and remove resolved templates like it works in .Net, or would I do it like C++?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:23:40+00:00Added an answer on May 22, 2026 at 5:23 pm

    The JVM allows any characters in class/field/method names except /, and ; which have a special meaning. Using numbers and other character is common for obfuscators to make de-compiling difficult.

    However you could just use the $ and _ for generated class/fields/methods.

    Note: JDK 7 is supposed to have better generic support with the Type with a combination of Class and generics.

    EDIT:

    One way to have proper generic type is to always use

    Set<String> set = new LinkedHashSet<String>() { }; 
    

    The use of { } creates an anonymous class which has a parent type with the generic you want. You can get this information via reflection.

    You can cache and remove class by having your own class loader which you dispose of as you wish. The most extreme case would be to have a ClassLoader per class.

    Once you have your own Generic types, you could just use these in your methods, like normal types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After taking a look at this SO question and doing my own research, it
After reading (nearly) the whole ebook and taking a look at the API i
After taking a look at theming for Fede's UberMusic I came across the file
Just noticed that Opengl ES 1.0, 1.1, and probably also 2.0 don't have an
After taking a look at some old code: //Nothing like a destructor!! function destroy()
When I go back to school after Thanksgiving, I'll be taking a course in
After reading this question , I was reminded of when I was taught Java
After being told by at least 10 people on SO that version control was
After reading a bit more about how Gnutella and other P2P networks function, I
I have a web application which uses URLs that look like this: http://library.example.com/Register.aspx?query=academic&key=586c70bb-5683-419c-aae9-e596af9ab66a (The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.