1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Java-what if char is: '

  1. Oct 12, 2011 #1


    User Avatar

    If I want to work with a character literal, and it is the apostrophe, how do I do this?

    For example:

    Code (Text):

       \\do something
       \\do something else

    Now, Word.charAt(0)==''' isnt allowed. In fact netbeans wont even let me type it. How do I overcome this?

    Thanks in advance
  2. jcsd
  3. Oct 12, 2011 #2


    User Avatar

    Staff: Mentor

    I would try '\''.

    But I can be wrong.
  4. Oct 12, 2011 #3


    User Avatar

    That worked. Thank you.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook