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 8454663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:05:08+00:00 2026-06-10T12:05:08+00:00

I am new to Java and I’m not quite sure how to output an

  • 0

I am new to Java and I’m not quite sure how to output an integer raised to a power as a string output. I know that

Math.pow(double, double)

will actually compute the value of raising a double to a power. But if I wanted to output “2^6” as an output (except with 6 as a superscript and not with the carat), how do I do that?

EDIT: This is for an Android app. I’m passing in the integer raised to the power as a string and I would like to know how to convert this to superscript in the UI for the phone.

  • 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-06-10T12:05:09+00:00Added an answer on June 10, 2026 at 12:05 pm

    If you’re outputting the text to the GUI then you can use HTML formatting and the <sup> tag to get a superscript. Otherwise, you’ll have to use Unicode characters to get the other superscripts. Wikipedia has a nice article on superscripts and subscripts in Unicode:

    http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts

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

Sidebar

Related Questions

I am starting a new Java web project that will be worked on by
SimpleDateFormat formatter = new SimpleDateFormat(ddMMyyyy_HHmmSS); String strCurrDate = formatter.format(new java.util.Date()); String strfileNm = Cust_Advice_
SimpleDateFormat formatter = new SimpleDateFormat(ddMMyyyy_HHmmSS); String strCurrDate = formatter.format(new java.util.Date()); String strfileNm = Customer_
I'm trying to build a new java swing component, I realise that I might
We are building a new Java 7 NIO.2 FileSystemProvider, and would like to not
I am relatively new Java developer that's been thrown in the deep end, my
url = new java.net.URL(s) doesn't work for me. I have a string C:\apache-tomcat-6.0.29\webapps\XEPServlet\files\m1.fo and
I'm new to Java and have searched for quite a time now on the
I'm creating a new Java project for a concept/construct that's usually referred to with
Consider the following code: java.util.Map<String, String> map = new java.util.HashMap<String, String>(); ... String key

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.