strings in java(18 june ,2011)

strings in java(18 june ,2011)

please explain me the flow of this program..not able to execute correctly n wats the use of clone

public class Strclone {

public static void main(String args[]) { String s=new String("a"); String s1 = "Hello"; System.out.println(s1.length()); String s2 = "Hello";

String s3 = new String(s1);

String s4 =(String) s2.clone();

Object c=s.clone();
String b;
if(s==b)
{
    System.out.println("true");

}
if(s.clone().equals(s))
{
    System.out.println("equals");
}

}

}

View Answers

June 20, 2011 at 11:36 AM

String s=new String("a"); String s4 =(String) s2.clone();

here s4 that same object as s2.clone method is used for creating same object...

Ads









Related Tutorials/Questions & Answers:
strings in java(18 june ,2011)
strings in java(18 june ,2011)  please explain me the flow of this program..not able to execute correctly n wats the use of clone public class Strclone { public static void main(String args[]) { String s=new String
strings in java(18 june ,2011)
strings in java(18 june ,2011)  please explain me the flow of this program..not able to execute correctly n wats the use of clone public class Strclone { public static void main(String args[]) { String s=new String
Advertisements
Switch Statement with Strings in Java
Switch Statement with Strings in Java  Switch Statement with Strings in Java
strings in java
strings in java  please explain me the flow of this program..not able to execute correctly n wats the use of clone public class Strclone { public static void main(String args[]) { String s=new String("a"); String s1
strings
strings  difference between the strings in java and c
compare two strings in java
compare two strings in java  How to compare two strings in java...) { System.out.println("The two strings are the same."); } } } Output: The two strings are the same. Description:-Here is an example of comparing two
hash function for java strings
hash function for java strings  hash function for java strings   int hash=7; for (int i=0; i < strlen; i++) { hash = hash*31+charAt(i
strings
strings  write a program in java to accept two strings as command line arguments and perform the following operations-: 1) compare the strings 2... is an example which accept two strings as command line arguments and perform
Appending Strings - Java Tutorials
.style1 { text-align: center; } Appending Strings In java, the two main ways for appending string at the end are : First method is using += operator. Second method is using append()  method. In this section, we
How do I compare strings in Java?
How do I compare strings in Java?  How do I compare strings in Java
strings
strings   read sentence and convert all the word into capital case like camelcase   Hi Friend, Try the following code: import java.util.*; class ConvertWordsIntoUpperCase { public static String toCamelCase(String
Strings
will contain strings which is separated by ",". From the main method invoke
validation of strings using java function
validation of strings using java function  hi all, i am uploading data from csv file to data base where i took student id as string of length 6 char of the form abc123 will you please give me a function to validate this field
Java create new array of strings.
Java create new array of strings.  Java create new array of strings.   Example: public class StringArray { public static void main(String[] args) { String name[] = { "mandy", "Rixi", "Ron
strings
strings  java program for removing multiple spaces into single space
strings
strings  1.Create a class named BuilderDemo. Use the string builder method to get the following output from string s4 Consider: String s4 = ??Java...) { String st="Java is an OO"; String str[]=st.split(""); String reversedSt
strings
strings  1.Create a class named BuilderDemo. Use the string builder method to get the following output from string s4 Consider: String s4 = ??Java...) { String st="Java is an OO"; String str[]=st.split(""); String reversedSt
Maven dependency for com.mastfrog - util-strings version 2.6.9 is released. Learn to use util-strings version 2.6.9 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.6.9 ) in their Java project... and includes  com.mastfrog - util-strings version 2.6.9 java library in your project...Maven dependency for  com.mastfrog  - Version 2.6.9 of util-strings
Concatenating two Strings in Java
Concatenating two Strings in Java In this section we will help you, how to concatenate two strings in java. String are sequence of character which is used... that concatenate the two strings. String str1="hello"; String str2=" Java
Maven dependency for com.mastfrog - util-strings version 2.7.2 is released. Learn to use util-strings version 2.7.2 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.7.2 ) in their Java project... and includes  com.mastfrog - util-strings version 2.7.2 java library in your project...Maven dependency for  com.mastfrog  - Version 2.7.2 of util-strings
Maven dependency for com.mastfrog - util-strings version 2.7.2.1 is released. Learn to use util-strings version 2.7.2.1 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.7.2.1 ) in their Java...-strings version 2.7.2.1 in Java projects. Follow the step by step tutorial for using... that downloads and includes  com.mastfrog - util-strings version 2.7.2.1 java library
Maven dependency for com.mastfrog - util-strings version 2.7.2.2 is released. Learn to use util-strings version 2.7.2.2 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.7.2.2 ) in their Java...-strings version 2.7.2.2 in Java projects. Follow the step by step tutorial for using... that downloads and includes  com.mastfrog - util-strings version 2.7.2.2 java library
Maven dependency for com.mastfrog - util-strings version 2.7.2.3 is released. Learn to use util-strings version 2.7.2.3 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.7.2.3 ) in their Java...-strings version 2.7.2.3 in Java projects. Follow the step by step tutorial for using... that downloads and includes  com.mastfrog - util-strings version 2.7.2.3 java library
Maven dependency for com.mastfrog - util-strings version 2.6.8 is released. Learn to use util-strings version 2.6.8 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.6.8 ) in their Java project... and includes  com.mastfrog - util-strings version 2.6.8 java library in your project...Maven dependency for  com.mastfrog  - Version 2.6.8 of util-strings
Maven dependency for com.mastfrog - util-strings version 2.6.10 is released. Learn to use util-strings version 2.6.10 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.6.10 ) in their Java... and includes  com.mastfrog - util-strings version 2.6.10 java library in your...Maven dependency for  com.mastfrog  - Version 2.6.10 of util-strings
Maven dependency for com.mastfrog - util-strings version 2.6.11 is released. Learn to use util-strings version 2.6.11 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.6.11 ) in their Java... and includes  com.mastfrog - util-strings version 2.6.11 java library in your...Maven dependency for  com.mastfrog  - Version 2.6.11 of util-strings
Maven dependency for com.mastfrog - util-strings version 2.6.11.1 is released. Learn to use util-strings version 2.6.11.1 in Maven based Java projects
use this version ( com.mastfrog - util-strings version 2.6.11.1 ) in their Java...-strings version 2.6.11.1 in Java projects. Follow the step by step tutorial... that downloads and includes  com.mastfrog - util-strings version 2.6.11.1 java
Maven dependency for com.mastfrog - util-strings version 2.6.11.2 is released. Learn to use util-strings version 2.6.11.2 in Maven based Java projects
use this version ( com.mastfrog - util-strings version 2.6.11.2 ) in their Java...-strings version 2.6.11.2 in Java projects. Follow the step by step tutorial... that downloads and includes  com.mastfrog - util-strings version 2.6.11.2 java
Maven dependency for com.mastfrog - util-strings version 2.6.12 is released. Learn to use util-strings version 2.6.12 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.6.12 ) in their Java... and includes  com.mastfrog - util-strings version 2.6.12 java library in your...Maven dependency for  com.mastfrog  - Version 2.6.12 of util-strings
Maven dependency for com.mastfrog - util-strings version 2.6.13 is released. Learn to use util-strings version 2.6.13 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.6.13 ) in their Java... and includes  com.mastfrog - util-strings version 2.6.13 java library in your...Maven dependency for  com.mastfrog  - Version 2.6.13 of util-strings
Maven dependency for com.mastfrog - util-strings version 2.7.0 is released. Learn to use util-strings version 2.7.0 in Maven based Java projects
this version ( com.mastfrog - util-strings version 2.7.0 ) in their Java project... and includes  com.mastfrog - util-strings version 2.7.0 java library in your project...Maven dependency for  com.mastfrog  - Version 2.7.0 of util-strings

Ads