Results 1 to 6 of 6
  1. #1
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Posts
    244
    Rep Power
    4

    Default inserting symbol

    how do you get | on the keyboard for the "if" statements?

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Uhm, by typing it?

  3. #3
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    Are you trying to ask how to use a vertical pipe in a conditional statement? - for instance
    Java Code:
    if(a == b || x == y){
        //do Something
    }
    In this case, || means or.

    Note! don't confuse with this with a single |. A single | is a bitwise or. If you don't know what bitwise means, even more reason not to use it, but if you're curious: Java Notes: Bitwise Operators

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by quad64bit View Post
    Note! don't confuse with this with a single |. A single | is a bitwise or. If you don't know what bitwise means, even more reason not to use it, but if you're curious: Java Notes: Bitwise Operators
    A single | also doubles as a 'logical' or (i.e. it accepts boolean type operands); it just doesn't short circuit as the double || does ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Posts
    118
    Rep Power
    0

    Default

    Quote Originally Posted by droidus View Post
    how do you get | on the keyboard for the "if" statements?
    Shift + "\", at least on English keyboards.

    Quote Originally Posted by masijade View Post
    Uhm, by typing it?
    LOL.

  6. #6
    droidus is offline Senior Member
    Join Date
    Feb 2011
    Posts
    244
    Rep Power
    4

    Default

    i see where it is... its the backslash key... it didn't look like a line because it was cut in half... weird
    and thanks, now i know how to use || :)

Similar Threads

  1. Help on inserting into table
    By ShinTec in forum JDBC
    Replies: 4
    Last Post: 06-08-2010, 09:26 AM
  2. Inserting textboxes
    By r.gnanaprakasam in forum New To Java
    Replies: 0
    Last Post: 04-22-2009, 02:48 PM
  3. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  4. Replies: 3
    Last Post: 05-01-2008, 08:30 AM
  5. Inserting into a table (Example)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-06-2008, 09:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •