UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How to compare to strings in Java language?

Asked by Last Modified  

7 Answers

Learn Java

Follow 0
Answer

Please enter your answer

Trainer

Using equals method
Comments

10 years of teaching experience in Engineering collges

equals(), compare(), ...
Comments

I am a IT professional

if you want to compare two strings by using (s1).equalsTo (s2). or by using compareTo
Comments

you can compare String using equals or equalsIgnoreCase methods of string class
Comments

Test Automation Expert with 23 years of Testing Experience - QTP, Selenium, Load runner

String class has method compare to do this. String Source_string = new String("Nagendra"); String Destination_string = new String("Nagendra"); String Temp_String = new String("Prasad"); // Following statement Returns true Source_String.equals(Destination_string); // Following statement Returns...
read more
String class has method compare to do this. String Source_string = new String("Nagendra"); String Destination_string = new String("Nagendra"); String Temp_String = new String("Prasad"); // Following statement Returns true Source_String.equals(Destination_string); // Following statement Returns false Source_String.equals(Temp_string); read less
Comments

Master of Science in Information Technology. Also I Have Post Graduate Diploma of Computer Applications, Certificate Course In Advanced Java, Certificate Course In MS-Office, DTP.

there are two String class functions available in Java- equals(String x) and equalsIgnoreCase(String x). EG- String s1="hello"; String s2="Hello"; System.out.println(s1.equals(s2)); System.out.println(s1.equalsIgnoreCase(s2)); first method compares two strings only with the exact sequence of characters...
read more
there are two String class functions available in Java- equals(String x) and equalsIgnoreCase(String x). EG- String s1="hello"; String s2="Hello"; System.out.println(s1.equals(s2)); System.out.println(s1.equalsIgnoreCase(s2)); first method compares two strings only with the exact sequence of characters in both strings but second method seeks for sequence and also the case of characters. read less
Comments

== and equals method ..
Comments

View 5 more Answers

Related Questions

How many years of experience should a good Java trainer need?
Minimum 4 years, actually it depends how much exposure you got and how you worked in project(s)
Nayan
0 0
5
Why Java Laguage is not provided get method into Iterator? is there any specific reson.
1) Iterator is an Interface. 2) It's sole purpose is to iterate not save value. POJO's have getters and setters.
Niraj Raj
best source to learn java from?
Main source if information on Java is oracle documentation. But it takes your time to read through, a lot more than you expect. Better prefer a trainer who can give what you need.
Himanshu
What is an Exception in Java?
Exception is the type of class which we are using in java to check and validate our code. if there is any problem in our code then compiler will throw exception. there are two types of exception. one is...
Piyush
0 0
5
If a class contains only a private constructor and no other constructor, is it possible to create object of that class? If yes how?
Yes, It is possible. But, Object can be created only with in that class (either in any method or block).
Shabbir

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

On the Job training is always best
On the job training always provides an opportunity to learn the best industry practices. While you work on real time you would encounter many challenges that will force you to learn many new things. Class...
M

Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

Software Testing
Software testing is a process of executing a program or application with the intent of finding the software bugs. It can also be stated as the process of validating and verifying that a software program...

Understanding concept of Inheritance in Java
Inheritance: Acquiring a properties and methods from Parent class to Child class. For example, In some cases we can hear from any one of your relative or your friends will say like that "You are bahaving...

JAVA - Object Cloning
JAVA - Object Cloning Is the way of creating the same copy of object without calling the class constructor. It means we can make any class object multiple times without calling its default constructor....

Recommended Articles

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more