What does the pipe character do in a Java method call? -


i've seen pipe character used in method calls in java programs.

for example:

public class testing1 {      public int print(int i1, int i2){         return i1 + i2;      }     public static void main(string[] args){         testing1 t1 = new testing1();         int t3 = t1.print(4, 3 | 2);         system.out.println(t3);     } } 

when run this, 7.

can explain pipe in method call , how use properly?

the pipe in 3 | 2 bitwise inclusive or operator, returns 3 in case (11 | 10 == 11 in binary).


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -