Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: ID Ekerete
Added: Jun 14, 2021 11:30 AM
Views: 224
Tags: no tags
  1. /*
  2.  *Parameter Passing - Primitives
  3.  */
  4.  
  5. /**
  6.  *
  7.  * @author ID
  8.  */
  9. public class JavaApplicationApp {
  10.     private int age;
  11.  
  12.     /**
  13.      * @param args the command line arguments
  14.      */
  15.     public static void main(String[] args) {
  16.         int i = 50;
  17.         boolean result;
  18.         JavaApplicationApp myApp = new JavaApplicationApp();
  19.         result =myApp.setAge(i);
  20.         System.out.println("i has the value:" +i);
  21.         System.out.println("result has the value:" + result);
  22.     }
  23.  
  24.     public boolean setAge(int suppAge)
  25.         {
  26.         this.age = suppAge;
  27.         suppAge = suppAge +1;
  28.         System.out.println ("suppAge has the value" + suppAge);
  29.         return true;
  30.  
  31.     }
  32. }