/* Example of Precedence */
package Precedence;
public class Precedence
{
public static void main(String[] args)
{
int a = 5, b = 10, c = 15, d = 20;
int x, y, z;
x = a * b - c;
y = a - d / b + c;
prln("a = " +a+ "\tb = "+b); // Implies(5 * 10) - 15, Not 5 * (10 - 15)
prln("c = " +c+ "\td = "+d); // Implies 5 - (20 / 10) + 15
prln("a * b - c = "+x);
prln("a - d / b + c = "+y);
}
static void prln(Object anyObject)
{
System.out.println(anyObject);
}
static void pr(Object anyObject)
{
System.out.print(anyObject);
}
}
package Precedence;
public class Precedence
{
public static void main(String[] args)
{
int a = 5, b = 10, c = 15, d = 20;
int x, y, z;
x = a * b - c;
y = a - d / b + c;
prln("a = " +a+ "\tb = "+b); // Implies(5 * 10) - 15, Not 5 * (10 - 15)
prln("c = " +c+ "\td = "+d); // Implies 5 - (20 / 10) + 15
prln("a * b - c = "+x);
prln("a - d / b + c = "+y);
}
static void prln(Object anyObject)
{
System.out.println(anyObject);
}
static void pr(Object anyObject)
{
System.out.print(anyObject);
}
}