Saturday, 11 February 2017

In java String can be Created by two ways 1.String str="krishna"; 2.String str=new String("krishna"); Can any one List out the Difference??

In java String can be Created by two ways
1.String str="krishna";
2.String str=new String("krishna");
Can any one List out the Difference??

1 comment:

  1. 1.creates and save in string pool constant
    2.saves in string pool constant and its reference is save in object

    ReplyDelete