「Groovy」文字列リテラルのサンプル

2021年8月31日

書式
1.シングルクォート '文字列’
2.ダブルくぉーと "文字列"

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
class SampleArk {
static void main(String[] args) {
//シングルクォート
String strA = 'Study';
//ダブルクォート
String strB = "Skill";
String strC = "'in " + " arkgame.com'";
println(strA);
println(strB);
println(strC);
}
}
class SampleArk { static void main(String[] args) { //シングルクォート String strA = 'Study'; //ダブルクォート String strB = "Skill"; String strC = "'in " + " arkgame.com'"; println(strA); println(strB); println(strC); } }
class SampleArk { 
   static void main(String[] args) { 
   
     //シングルクォート
      String strA = 'Study';
      //ダブルクォート 
      String strB = "Skill"; 
      String strC = "'in " + " arkgame.com'";
            
      println(strA); 
      println(strB); 
      println(strC); 
   } 
}

結果
Study
Skill
'in arkgame.com’

Groovy

Posted by arkgame