Explain the term- comparing strings, JAVA Programming

Explain the term- Comparing Strings

For comparing Strings never use == operator, use equals method of String class.

- == operator compares addresses (shallow comparison) while equals compares values (deep comparison)

For instance: string1.equals (string2)


Posted Date: 9/20/2013 3:44:27 AM | Location : United States

Related Discussions:- Explain the term- comparing strings, Assignment Help, Ask Question on Explain the term- comparing strings, Get Answer, Expert's Help, Explain the term- comparing strings Discussions

Write discussion on Explain the term- comparing strings
Your posts are moderated
Related Questions
there is a pebble merchant. he sells the pebbles,that are used for shining the floor.his main duty is to take the length of the room side but he sometines mistakes doing that and m

Explain Subclasses and Polymorphism ? Car and Motorcycle are subclasses of MotorVehicle. If you instantiate a Car or a Motorcycle along with new, you can use in which object a

What are the advantages of multimedia presentations? Write any five. Following are the benefits of multimedia presentations: • Great tool for efficiently communicating ideas

can i have code on this assignment: The code in the main method should do the following: 1. Prompt the user for a string input value for the amount in dollars and store it in a va

Taking in Command Line Arguments In Java, the program can be written to accept command-line-arguments. Example Code:  command-line arguments /*  This

What is the difference between instance and object of a class? Few says both are same, then why java kept both the words for same thing?

Why Local variable is preferred over Global variable ? In my point of view Global variable has a few advantage along with Local variables is preferred because of the subsequent

need a java program that can read and display the values from a windows registry

A Padovan string P(n) for a natural number n is defined as: P(0)=''X'' P(1)=''Y'' P(2)=''Z'' for a string characters ''X'',''Y'',''Z'' only,and given value of n,write a program th

How to Creating Arrays in java? Declaring arrays merely says what type of values the array will hold. It does not form them. Java arrays are objects, and such as any other obje