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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:52:19+00:00 2026-05-10T16:52:19+00:00

In Scala, is it possible to get the string representation of a type at

  • 0

In Scala, is it possible to get the string representation of a type at runtime? I am trying to do something along these lines:

def printTheNameOfThisType[T]() = {   println(T.toString) } 
  • 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. 2026-05-10T16:52:20+00:00Added an answer on May 10, 2026 at 4:52 pm

    Note: this answer is out of date!

    Please see answer using TypeTag for Scala 2.10 and above

    May I recommend #Scala on freenode

    10:48 <seet_> http://stackoverflow.com/questions/190368/getting-the-string-representation-of-a-type-at-runtime-in-scala <-- isnt this posible? 10:48 <seet_> possible 10:48 <lambdabot> Title: Getting the string representation of a type at runtime in Scala - Stack Overflow,                   http://tinyurl.com/53242l 10:49 <mapreduce> Types aren't objects. 10:49 <mapreduce> or values 10:49 <mapreduce> println(classOf[T]) should give you something, but probably not what you want. 

    Description of classOf

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

Sidebar

Related Questions

Is it possible to get the name of a scala variable at runtime? E.g.
Is it possible to get the type name of a generic class in Scala?
Is it possible to create types like e.g. String(20) in scala? The aim would
Possible Duplicate: Trying to get tag-it to work with an AJAX call How can
In Scala, the higher order operations on collections always return the best possible type
Possible Duplicate: How to unimport String “+” operator in Scala? So things from Predef
In Scala it's possible to use the annotation @BeanProperty to automatically generate getters and
Possible Duplicate: What is the rationale behind having companion objects in Scala? Thanks for
Is it possible to extend multiple classes in Scala. For example if I have
Say you define the following: class Person(name: String, age: Int) { def toXml =

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.