Using quotation marks

Discussion in 'Java' started by Radith, Jan 7, 2005.

  1. Radith

    Radith Guest

    I need to display the following:

    This is the value of "A.1." being accessed from main():

    At the moment I have System.out.println("This is the value of A.1. being
    accessed from main(): ");
    What modifications do i need to make to get quotation marks around A.1.

    Cheers
     
    Radith, Jan 7, 2005
    #1
    1. Advertising

  2. Radith

    Skip Guest

    "Radith" <> wrote in message
    news:9nkDd.5536$...
    > I need to display the following:
    >
    > This is the value of "A.1." being accessed from main():
    >
    > At the moment I have System.out.println("This is the value of A.1. being
    > accessed from main(): ");
    > What modifications do i need to make to get quotation marks around A.1.


    You need to escape the quotation marks: \"
    System.out.println("foo \"bar\" ...");
    results in:
    foo "bar" ...
    being printed to stdout.
     
    Skip, Jan 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    605
  2. Tristan Miller
    Replies:
    54
    Views:
    1,467
    ???????? ????? ???????????
    Nov 6, 2003
  3. M. Clift

    String and quotation marks

    M. Clift, Oct 22, 2004, in forum: Python
    Replies:
    2
    Views:
    384
    M. Clift
    Oct 22, 2004
  4. Peng Yu

    Question about concatenating quotation marks

    Peng Yu, Oct 1, 2004, in forum: C Programming
    Replies:
    3
    Views:
    354
    Mark McIntyre
    Oct 2, 2004
  5. Junior
    Replies:
    4
    Views:
    325
    Dennis Lee Bieber
    Oct 27, 2007
Loading...

Share This Page