// Java program to illustrate how to check // whether the length of two strings is // equal or not using the length() method. importjava.io.*; classGFG{ publicstaticvoidmain(String[]args) { Strings1="abc"; Strings2="xyz"; // storing the length of both the // strings in int va...
// Java program to demonstrate the usage of // repeat() method importjava.io.*; classGFG{ publicstaticvoidmain(String[]args){ Stringstring="xyz"; intcount=0; System.out.println("string :"+string.repeat(count)); } } 输出 string: 注:本文由VeryToolz翻译自String Class repeat() Method in...