fork download
  1. class ArithmeticDemo {
  2.  
  3. public static void main (String[] args)
  4. {
  5. int result;
  6. result=-2 + 5 * 7- 7 / 2 % 5;
  7. System.out.println("The result is: " + result);
  8. }
  9. }
Success #stdin #stdout 0.12s 53676KB
stdin
public class MyParameterizedConstructor
{
   private String name;

   public MyParameterizedConstructor(String str){
       this.name = str;
        System.out.println("I am inside parameterized constructor.");
        System.out.println("The parameter value is: "+str);
    }

   public static void main(String a[]){
     MyParameterizedConstructor mpc = new MyParameterizedConstructor("Madhu Raj");
   }
 }
stdout
The result is: 30