Groovy - Printing Variables Code Example

The code for Printing Variables

class Example { 
   static void main(String[] args) { 
      //Initializing variables 
      int var1 = 10; 
      int var2 = 20; 
	  
      //Printing the values
      println("The value of var1 is " + var1 + " and value of var2 is " + var2);
   }
}

/*
Output:
The value of var1 is 10 and value of var2 is 20
*/
Code by IncludeHelp, on August 9, 2022 15:30

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.