Back

Forum Replies Created

Viewing 0 reply threads
  • Author
    Posts
    • #13781
      KFisher
      Participant

      You can create String in Java using two methods.
      1. Using String literal
      Example:
      String str1=”Welcome”;
      String str2=”Java”;

      2. Using “new” keyword
      Example:
      String str1=new String(“Welcome”);
      String str2=new String(“Java”);

Viewing 0 reply threads