package com.testProject;
public class JavaSample {
    public static void main(String[] args) {
        String myString1 = new String("Sample1");
        System.out.println(myString1);
        String myString2 = new String("Sample2");
        System.out.println(myString2);
    }
}
in the above piece of code how to print the address of these Strings which i created "Sample1" and "Sample2", i need to print the memory location of the String object myString1 and myString2
 
     
     
     
     
     
     
     
     
     
    