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

Can finally block be used without try block?
No. But it can be used without a catch block.
Sarala
What are the benefits of attending Java coaching classes?
Today Java is the basic requirement for the software industry by learning advanced concepts in java you will have a very good job prospective's. Even if you want to learn BIg Data, testing tools ect.....
Selvi
0 0
5
Is Java a better programming language than C++?
If you campareboth then java has an edge n many oppurtunities compared to c++
Coaching Center
Can a class have interface and vice-versa?
how its possible both has different meaning you cant enclosed it
Deepa
0 0
7
What are the most important topics in Java interviews for a fresher?
OOPS Multithreding String Handling Execption Handling Collection Freamwork JDBC Servlet Jsp Spring core Moudle Spring MVC
Advaith
0 0
6

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

Ask a Question

Related Lessons

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

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

Java Advantages
In this video, learn about Java and its advantages. Also, check out the difference between Java and C++, Java development kit, Java Run Time Environment (JRE) with a proper demonstration program for better clarity.

How to create a Singleton class?
How to create a Singleton class: Q) What is a singleton class? A) In simple words, a singleton class is a class which can have only one instance at any point of time throughout the application and provides...

Java inheritance example
Answer these questions Answer the above question

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