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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:49:01+00:00 2026-06-03T12:49:01+00:00

I am a bit rusty on my Java. I have an array with several

  • 0

I am a bit rusty on my Java. I have an array with several values one of which is used in an if statement.

It’s a single character I’m checking and the fact that it’s not working leads me to believe it may be a whitespace issue. The data is coming in from a mysql database and I already tried using trim() on the query to get rid of any whitespaces but no luck.

Here’s the code:

  Payoff payoff=new PlainVanillaPayoff(Option.Type.Put,Strike);
  if(inputData[8] == "C"){
      System.out.println("TypeCall"); // Check to see whether if stmt is ever true.
      payoff=new PlainVanillaPayoff(Option.Type.Call,Strike);
  } else{}

The print statement called inside the if statement never prints.

Any suggestions?

  • 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-06-03T12:49:03+00:00Added an answer on June 3, 2026 at 12:49 pm

    This is because you are comparing Strings using ==. You should use equals instead.

    if(inputData[8].equals("C"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a bit rusty on my regexp and Javascript. I have the following string
My knowledge about implementing a parser is a bit rusty. I have no idea
After two years of C#, my VB.NET is a bit rusty. I have two
Bit rusty on the sql side as I have not touched in a while
HI, I have a down casting question, I am a bit rusty in this
Just a bit rusty on the old linq. If I have 2 collections EG
I am a bit rusty with threaded programs especially in windows. I have created
My XPath is a little bit rusty... Let's say I have this simple XML
I have to admit my C++ is a bit rusty. In a project I
I'm pretty new to Android but I have some experience (and a bit rusty

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.