Not sure why my IF statement isn't returning true

2021.10.20 01:08 ttvSooggyy Not sure why my IF statement isn't returning true

The task is that I have to differentiate 2 kinds of inputs, manatee names and query requests of those manatee names.
command-line example of a name input "A_Manatee"
command-line example of a query "? A_Manatee Hugh_Manatee"
(question mark means to query and there are 2 names after are to be looked for in an array list)
(no quotes in normal input)

I'm having an issue getting the first IF statement to return true (returns true when targets == "?")
I need to essentially check for the questionmark, if there is none i store the name if there is i do the lookup for the 2 token names.
I've tried to see where it goes wrong using println and I know that targets has the value of "?" but the if statement won't return true.
Code:

import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Search { public static void main (final String[] args) { final Scanner in = new Scanner (System.in); final ArrayList  hitList = new ArrayList  (); while (in.hasNextLine()) { final String manatee = in.nextLine(); final Scanner input = new Scanner (manatee); final String targets = input.next(); System.out.println(targets); // testing purposes if (targets == "?") { final String name1 = in.next(); System.out.println(name1); // testing purposes final String name2 = in.next(); System.out.println(name2); // testing purposes int pos1 = 0; int pos2 = 0; for (int i = 0; i < hitList.size(); i++) { if (name1.equals(hitList.get(i))) { pos1 = i; } } for (int i = 0; i > hitList.size(); i--) { if (name2.equals(hitList.get(i))) { pos2 = i; } } if (pos1 == -1 || pos2 == -1) { System.out.println("Absent"); } else if (pos1 > pos2) { System.out.println("Nonesuch"); } else { final ArrayList  SortedHitList = new ArrayList  (hitList.subList(pos1, pos2)); Collections.sort(SortedHitList); int count = 0; for (int i = 0; i < SortedHitList.size(); i++) { System.out.printf(" %d: %s",count++ ,SortedHitList.get(i)); } } } else if (targets == "") { in.close(); input.close(); break; } else { hitList.add(targets); } } } } 
I'm not too concerned about the logic past the first if statement as I think it mostly correct and if it's wrong I'm pretty sure I can revise it, but this dam if statement has me confused.

But if you do see anything wrong that i don't see please feel free to let me know.
Java 16 IDE: VsCode
submitted by ttvSooggyy to javahelp [link] [comments]


2021.10.20 01:08 Odd_Assignment_5290 Taken out at the dog park

My 60-pound pup and his friend crashed into me at the dog park this morning causing my knee cap to dislocate ๐Ÿ˜…
Any tips on not getting plowed over at the dog park?
submitted by Odd_Assignment_5290 to Dogtraining [link] [comments]


2021.10.20 01:08 daktarbabu Will the communal bullying against DOs ever go away?

Itโ€™s not about the job or training or education: this time itโ€™s about the society. Pulling on the DOs have become quite easy after the Hasan incident and many more. Just saw a guy get into a fight with someone who called DOs JV. You can try to win against a wise person with logic, but you will never win against an ignorant person: most of society is ignorant. How long will it take the DOs to finally get rid of this โ€œJVโ€ image from the society?
submitted by daktarbabu to Osteopathic [link] [comments]


2021.10.20 01:08 Khaleesi_1lt [FT] DIYS [LF] NMTS

- Gift Pile submitted by Khaleesi_1lt to ACTrade [link] [comments]


2021.10.20 01:08 bluedragonraven89 let's play Star Wars Kotor part 1 - under Sith attack

submitted by bluedragonraven89 to YouTubeAndGaming [link] [comments]


2021.10.20 01:08 AlitaTeam ๐Ÿ’ฅThe Winner of our Weekly Price Prediction Contest is...๐Ÿ’ฅ

๐Ÿ’ฅThe Winner of our Weekly Price Prediction Contest is...๐Ÿ’ฅ https://preview.redd.it/6ec94ych5ju71.jpg?width=1280&format=pjpg&auto=webp&s=edf25a3b02b90ec27c587eff0625aefe049dbf58
๐Ÿ’ฅThe Winner of our Weekly Price Prediction Contest is...๐Ÿ’ฅ
Tanish Singla
๐Ÿ’ฐ Congratulations !! You've just won 100 USDT !!
The exact answer was $9.28074 and this participant has been the closest !
Please contact u/wizard_alita to receive your prize !
๐Ÿ‘‰๐Ÿป Be ready for this week new Price Prediction Contest !
โœ… Subscribe to our channels to be informed of all Alita's news :
Telegram Community
Telegram Announcement
Twitter
submitted by AlitaTeam to alitafinance [link] [comments]


2021.10.20 01:08 I_am_kuro Admire the moon [Original]

Admire the moon [Original] submitted by I_am_kuro to anime_human_girls [link] [comments]


2021.10.20 01:08 cassshbaby Nice

Nice submitted by cassshbaby to ufc [link] [comments]


2021.10.20 01:08 DigiLeaf123 New to DashCam World! Need Recommendations!

Hey guys! Iโ€™m new to the idea of having vehicle monitoring cameras, but since purchasing a brand new vehicle Im genuinely considering it. Ideally I would like something for the front and rear, and I would like the front camera to swivel 360ยฐ for certain instances. Does anyone in this group know of a particular setup off hand that could accommodate my needs? Please and thank you in advance!
submitted by DigiLeaf123 to Dashcam [link] [comments]


2021.10.20 01:08 Thereal-_-kirito Modder , Plz report heโ€™s spamming kurama link mode and insect jamming technique and has the 1 shot mod his psn is EverythingNelly

Modder , Plz report heโ€™s spamming kurama link mode and insect jamming technique and has the 1 shot mod his psn is EverythingNelly submitted by Thereal-_-kirito to NarutoShinobiStriker [link] [comments]


2021.10.20 01:08 Jackieboyoboy What are some good role-playing of story driven games

I think I've played most rp game but maybe i missed a few
Im on xbox btw
submitted by Jackieboyoboy to gamerecommendations [link] [comments]


2021.10.20 01:08 amswy Run, here she comes!

Run, here she comes! submitted by amswy to memes [link] [comments]


2021.10.20 01:08 petter12346 Do you play with bets? Bit game is what you need!

Different from other traditional platforms, Bitgame aims to create a multi-dimensional entertainment platform that benefits sharing, sustainable development, and cryptocurrency assets.
https://www.bitgame.com/
submitted by petter12346 to CryptocurrencyICO [link] [comments]


2021.10.20 01:08 adyn211 check

submitted by adyn211 to ShadowBan [link] [comments]


2021.10.20 01:08 reddit_feed_bot DailyCaller: GOP Rep. Jeff Fortenberry Charged After Allegedly Lying To Feds https://t.co/gf3d11kMVJ

DailyCaller: GOP Rep. Jeff Fortenberry Charged After Allegedly Lying To Feds https://t.co/gf3d11kMVJ submitted by reddit_feed_bot to TheTwitterFeed [link] [comments]


2021.10.20 01:08 Dylan_213 vortex

vortex after updating vortex, it now shows up like this, how do I fix this?
https://preview.redd.it/73guphjh5ju71.png?width=63&format=png&auto=webp&s=2d55f78641ff23e484c1fcb1b215fd2acac6b45d
submitted by Dylan_213 to nexusmods [link] [comments]


2021.10.20 01:08 -Omegamart- GE, Union Pacific Mandate Covid-19 Vaccine for U.S. Workers

GE, Union Pacific Mandate Covid-19 Vaccine for U.S. Workers submitted by -Omegamart- to CoronavirusUS [link] [comments]


2021.10.20 01:08 gourmand183 Engine seizing up

So I bought a 2018 Kia soul for my son and in less than a yearโ€™s time the engine seized up on it. It was still under warranty and the dealer replaced it, and unfortunately a short time later he was hit in the car was totaled. So we took the money and bought a second 2018 Kia soul and now less than a year later once again it appears the engine has seized up. When I spoke to the tow truck driver who came to take it to the dealership he said that he was taking a number of cars tear for the exact same problem, not just the 2018 Kia soul either. Has anyone heard of there being a large issue with Kia engines?
submitted by gourmand183 to KiaSoulClub [link] [comments]


2021.10.20 01:08 Candycayne84 My zippys best pics. Lost her almost a year ago. She was the best cat, saw me through so much. I miss her but she is in a better place.

My zippys best pics. Lost her almost a year ago. She was the best cat, saw me through so much. I miss her but she is in a better place. submitted by Candycayne84 to cats [link] [comments]


2021.10.20 01:08 Lochness50 Piercings 4, 5 and 6 today! Went in wanting a double lobe and the piercer asked if I wanted a third for no extra, I'm not going to say no! I love them

Piercings 4, 5 and 6 today! Went in wanting a double lobe and the piercer asked if I wanted a third for no extra, I'm not going to say no! I love them submitted by Lochness50 to piercing [link] [comments]


2021.10.20 01:08 ColdChemist7921 ๐Ÿ”ฅExtremeShiba launch now ๐Ÿ”ฅ | 7% Shiba Rewards Based Dev!!! | True GEM ๐Ÿš€ | Anti-scam | Huge potential

Welcome to ExtremeShiba
By buying and holding ExtremeShiba you will get automatically Shiba ๐Ÿ’ธrewards every hour. Big marketing is getting done by a well known Dev Team in the industry (Influencers onboard, Paids Ads & much more )๐Ÿš€๐Ÿš€๐Ÿš€ You dont want to miss this gem! Doxxed Dev
You can invest and collect Shiba before Shiba flys to the Moon
Tokenomics:
โœ… 10% transaction fee
โœ…๐Ÿ’ธ7% Shiba reflections
โœ…๐Ÿ’ธ1% Liquidity
โœ…๐Ÿ’ธ2% Marketing
Where to buy?- You can buy the token on PancakeSwap! You can easily swap your BNBs to ExtremeShiba
๐Ÿ“ Contract:
Get on the train and shill everywhere. Itโ€™s safer than Safe. We the best token in the whole world ๐Ÿ˜Š
We gonna hire a lot of influencer like cryptic maestro or crypto messiah. A lot of marketing will come. Listing on coinsniper and other listing sites are in the way too. We the best ๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€
Knowing that you can invest in the token and be safe โ€“ not having something that is a honey pot or a rug pull based upon the developers history you know you can buy in and be able to trade safely.
Check out the telegram and meet the community. There have been some good laughs along the way. Community is growing fast!
๐Ÿš€ LINKS:
๐Ÿ“ CONTRACT: 0x26f45146940e6f101b852c395fc6a9b3353ab214
BUY HERE : https://pancakeswap.finance/swap?outputCurrency=0x26f45146940e6f101b852c395fc6a9b3353ab214
LP LOCKED: https://deeplock.io/lock/0x497972C2a11f0c71Fe491509CEBc23726B49Ece4
Renounced Ownership: https://bscscan.com/token/0x26f45146940e6f101b852c395fc6a9b3353ab214#readContract
submitted by ColdChemist7921 to cryptostreetbets [link] [comments]


2021.10.20 01:08 hamked Happy 22nd Birthday to the young goat๐Ÿ๐Ÿ’š

Happy 22nd Birthday to the young goat๐Ÿ๐Ÿ’š submitted by hamked to DaDumbWay [link] [comments]


2021.10.20 01:08 uhwhynico how my experience with the battlefield 2042 beta went

how my experience with the battlefield 2042 beta went submitted by uhwhynico to GetMoreViewsYT [link] [comments]


2021.10.20 01:08 abourne "Ravens are dominant team" - Mina Kimes insists Lamar Jackson will lead Ravens to win AFC Championship

submitted by abourne to ravens [link] [comments]


2021.10.20 01:08 Euripideez this hits different

this hits different submitted by Euripideez to PhilosophyMemes [link] [comments]


http://mi-fan-rest.ru