Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7087651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:42:01+00:00 2026-05-28T07:42:01+00:00

I am having this strange behavior when performing a method which the if statement

  • 0

I am having this strange behavior when performing a method which the if statement where both values are true but it fails to go over the if statement.

Here is the code and how it looks like. On top right where it is circled red is the value of className.

If anyone has an idea why this is occurring or might have a better way of doing it please respond or guide me to a better coding logic to that I am already using.

On debug className = “rwb”

public void ClassReturn(){
        String tempName = getIntent().getExtras().getString("CLASS_NAME"); 
        if(tempName == null){
            Log.i("Intent Delivery", "Intent deliver has failed.");
        }else{
        String className = tempName; // This is return back to the correct class your in
            if(className == "rwb"){
                Intent intent = new Intent(BasicOption.this, ReadWholeBook.class);
                startActivity(intent);
            }
        }
    }

Strange Coding behaviour

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:42:02+00:00Added an answer on May 28, 2026 at 7:42 am

    Use .equals() to check if two objects are logically equal, use == the check if they are the same object.

    Strings in java can be more complicated because of interning but basically you want to use the .equals() or .equalsIgnoreCase() to check the contents of the two strings are the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having some strange behavior here. I have some XSLT which generates some html with
I'm having a strange behavior with PHP, GD, and libJPEG Here is my phpinfo()
I'm having this strange error for the devise_invitable extension: uninitialized constant ActiveSupport::SecureRandom But the
I'm having a strange behavior in my .aspx page. I'm internationalizing some pages, but
i am having a strange problem, i have a static class like this public
Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
I'm having this problem, same as ever, but never try to find the right
I'm having quite a difficulty, figuring out some strange behavior when looping through symbols
I am recently having this strange issue in my Visual Studio 2008 professional. Whenever
I'm having a strange behavior with an operator overloading in C++. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.