Welcome To The World Of Hacking


Learn Hacking|Teach Hacking|Learn To Secure|Learn To Code

Sunday

JAVA PROGRAMMING TUTORIAL 34 : HOW TO FIND LENGTH OF A STRING

public class HackDefence {

        public static void main(String args[]) {

               String myString = "Hello! I am a programmer"; // myString is a string variable
   
               int len = myString.length(); // length() is a inbuilt function in java to find length
   
               System.out.println( "Given string length : " + len );
   
        }
 
}

OUTPUT:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...