Skip to content

Instantly share code, notes, and snippets.

@MrRahulR
Last active June 5, 2021 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrRahulR/b47efb070fec919d526379bdf09a4ab6 to your computer and use it in GitHub Desktop.
Save MrRahulR/b47efb070fec919d526379bdf09a4ab6 to your computer and use it in GitHub Desktop.
StringCreation.java
public class StringCreation {
public static void main(String[] args) {
String greeting = "Hello";
int count = greeting.length();
System.out.println("Length is " + greeting.length());
System.out.println(count);
}
}
/*
Output :
Length is 5
5
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment