Please see my comment to the question. Strings themselves, just plain text, don't carry any markup/formatting.
Only in the case when your text in subscript/superscript are just digits, you can use the Unicode character for all decimal digits. I hope I don't need to explain you that Java works with Unicode characters and strings. Watch this:
0⁰₀ 1¹₁ 2²₂3³₃ 4⁴₄ 5⁵₅ 6⁶₆ 7⁷₇ 8⁸₈ 9⁹₉
I did not use any HTML markup in this example. Superscript digits have
code points U+2070 to U+2079, and subscripts '- U+2080 to U+2089, there are few more superscripted/subscripted characters. Please see:
http://unicode.org,
http://unicode.org/charts/PDF/U2070.pdf.
Not sure it makes a lot of practical sense, but you got the answer.
—SA