We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  • Hiring developers?
  1. Practice
  2. Java
  3. Introduction
  4. Java Int to String
  5. Discussions

Java Int to String

  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

    You are viewing a single comment's thread. Return to all comments →

  • RodneyShag 3 years ago+ 3 comments

    We know that "" is of type String. It is known as the empty string. It is a String with no characters in it. The + operator, when used on the right side of a String, simply connects stuff to the right of the original String. If what it's connecting is not yet a String, it automatically converts it into one, which is what we want for this exercise.

    "" + "Hello" + "there."
    

    becomes the String "Hello there." and

    "" + n
    

    becomes the String n, where n was automatically converted into a String for us.

    HackerRank solutions.

    53|
    ParentPermalink
    • kunnu120 3 years ago+ 0 comments

      Thank you very much

      0|
      ParentPermalink
    • betaprogrammers 2 years ago+ 0 comments

      3rd one was simple and smart. Thanks

      3|
      ParentPermalink
    • capspammail9 8 months ago+ 1 comment

      General Kenobi

      5|
      ParentPermalink
      • sebinp77 5 months ago+ 0 comments
        [deleted]
        0|
        ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature