hello guys,
well basically i have zero java knowledge, so don't mind me asking such kind of dumbass question( to you but not to me lol)
so, i have a .txt file in which there is a number in such line (for example, 0 and 1)
i want to print out "yes" if all numbers are 0,
print out "no" if all numbers are 1,
and print out nothing if the numbers are not the same, i.e. some are 0 and some are 1.
how can i do it?
thanks
shungkiu.lee
0
Newbie Poster
Recommended Answers
Jump to PostThere are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you.
DaniWeb Member Rules (which you agreed to when you signed up) …
Jump to Post... except ...
Scanner is an overkill way to read lines from a text file
and
the algorithm you describe is in no way a solution to the requiremnt as posted.
All 6 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
stultuske
1,116
Posting Maven
Featured Poster
Slavi
94
Master Poster
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Slavi
94
Master Poster
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.