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 6163077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:45:51+00:00 2026-05-23T21:45:51+00:00

It seems to me that this if statement is not working. I’m new in

  • 0

It seems to me that this if statement is not working.

I’m new in java, but i know C# and C++ pretty well, but I’ve never seen such a thing before:

today=edit[0].substring(0,10);
if (today == edit[0].substring(0,10))
{
    pars_prog.addView(name_prog[i]);
}

And it doesn’t get into the IF function?

Are if statements different in Java (Android)?

  • 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-23T21:45:52+00:00Added an answer on May 23, 2026 at 9:45 pm

    When you use == for any object references (whether strings or any other non-primitive type) it simply compares whether the references are equal – i.e. whether they refer to the exact same object, or whether they’re both null.

    In this case, you want to determine whether the strings are equal – i.e. whether they represent the same sequence of characters. You should use the equals method for that:

    if (today.equals(edit[0].substring(0,10)))
    

    However, in general when doing this you should be careful that the target of the equals call is non-null, or you’ll get a NullPointerException.

    Note that C# is similar – except that the == operator can be overloaded, and is overloaded for string. If the compile-time types of the operands aren’t both string, you’ll still get reference comparison:

    object text1 = new StringBuilder("hello").ToString();
    object text2 = new StringBuilder("hello").ToString();
    Console.WriteLine(text1 == text2); // False
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like a simple request. But my query in not working and I'm
I noticed that this recipe seems to use __rlshift__ , __ror__ like operators. But,
Since RAM seems to be the new disk , and since that statement also
It seems that this part of my code is where the exception occurs: c
that seems tricky. My IPad freezes and it seems that this line of code
I have searched around, and it seems that this is a limitation in MS
It seems that often __init__ methods are similar to this: def __init__(self, ivar1, ivar2,
It seems that i cannot access $(this) inside jquery ajax success function. please see
I googled this and it seems that no one has an answer, yet it
in this example, it seems that we can use a variable (here second) to

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.