Computer Science, asked by shubhusinghu420, 2 months ago

Illustrate the concept of sample program to create and print string in Java?​

Answers

Answered by NikitaDutta2007
1

Answer:

There are two ways to create a String object:

1. By string literal : Java String literal is created by using double quotes. For Example: String s=“Welcome”;

2. By new keyword : Java String is created by using a keyword “new”. For example: String s=new String(“Welcome”);

HOPE IT HELPS. ☺️

Similar questions