strings in java(18 june ,2011)

Ads
 

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

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
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  difference between the strings in java and c
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
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  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
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
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
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
new java technologies 2011
new java technologies 2011  what are the new java technologies in 2011
Strings in PHP
Strings in PHP  Hi, I am beginners and want to know about strings in PHP and different ways to print a string. Can someone help me in this regards?   Following tutorials will help you in details about strings in PHP
strings concatnation
strings concatnation  in string1 "123456 ABC DEF...",IN string2 "raveen". iwant to add string2 after 123456 in the first string based on index number.i need logic
strings 20june
strings 20june  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
strings
strings
strings
strings
strings
Strings
programes on strings
programes on strings   a. write a program to copy one array to another array using System.arrayCopy() method. b. write a program to check whether entered string is palindrome or not.   Have a look at the following link
Strings in Switch statement
Strings in Switch statement In this section, you will learn about strings in switch statements which is recently added feature in Java SE 7. Using JDK 7... C:\Program Files\Java\jdk1.7.0\bin>javac
java program 18 algorthm
java program 18 algorthm  writ a alogrithm for this program to get... hour format is :18 current minute is:28 current second is:54 current milisecond is:797 current full date time is:12-25-2007 18:28:54.797

Ads