Brooo nega mass bro vera lvl bro nee Java na enna naee theriyama irutha tomorrow exam adhan pakkalam nu vandhan unga video pathathula iruthu romba easya iruku 💓 super uhh teach pannura bro
public class pro2 { public static void main(String args[]) { String str; str="codeio"; int s=str.length(); System.out.println("the value is :"+s); } } output-6
public class Letter_counter { public static void main(String[] args) { String word = "code io"; System.out.println("word : " + word); int count = 0; for (int i = 0; i < word.length(); i++){ if (Character.isLetter(word.charAt(i))) count++; } System.out.println("Letter count : " + count); } } Output : word : code io Letter count : 6
String c_Name = "code io"; int length = c_Name.length(); System.out.println("Length of the Channel Name - " + length); Console Output: Length of the Channel Name - 7
Intha function'la irunthuthan, program start aggum. Ithu illaenda Namma write panna code'ah execute panna mudiyathu. static'nda keyword use panirukanala, nammalal object create pannama oru method'ah call panna mudiyum. So ithu mandatory.
public class Char_count { public static void main(String[] args) { String Codeio_name = "Code io"; long char_count = Codeio_name.length(); System.out.println(char_count); } } Output: 7 Process finished with exit code 0