This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java array problem  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for your answer to my previous post.I have an issue with array now
I should use seqSearch and binary search.I have an array with 10 slots .a)I should check if on this 8 slots if there are students and where they are , b) after to make a binary search on the array. c)seqsearch by his code or by his last name .Especialy on the c) i have real big problem.I did this on c but is mistake .help please
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte ektelestis wrote:thanks a lot for your answer to my previous post.I have an issue with array now

Hi Ekte, and welcome to JavaRanch.

Please UseCodeTags when posting code. I've added them for you this time to show you what it looks like.

Unfortunately, your indenting is also really bad. Try and arrange your code so that it lines up properly. It makes it a lot easier for us to answer your questions then.

Thanks.

Winston
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
ekte ektelestis wrote:thanks a lot for your answer to my previous post.I have an issue with array now

Hi Ekte, and welcome to JavaRanch.

Please UseCodeTags when posting code. I've added them for you this time to show you what it looks like.

Unfortunately, your indenting is also really bad. Try and arrange your code so that it lines up properly. It makes it a lot easier for us to answer your questions then.

Thanks.

Winston

Dont look at my code is false i know .Read the text there are a lot of things i should do and i cant
 
Manoj Kumar Jain
Ranch Hand
Posts: 198
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dont look at my code is false i know .Read the text there are a lot of things i should do and i cant

Hi Ekte,
You need to share what you have tried, what you were expecting and what was the output (may be some error message). if you can point out the problem where you are stuck we can help you out.
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to much but I delete it all.It was all mistake.I should create an array with 8slots.On this array I should check if is empty or if there are students.The possible answers would be a student,two students until 8.How could I all that? After this I should do search on the array. The search will be by his lastnane. Can you make a simple code for this things?
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to search an int or double. What I don't know is how to search on an array a string Lastname
 
Campbell Ritchie
Marshal
Posts: 55722
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please indent your code crrectly. Yoou can hide all sorts of errors from yourself behind incorrect indentation.
You have some confusion about the == operator. Don't use it on reference types because it will give the “wrong” results. Also it is possible to write = by mistake instead of ==, in which case you have a type which is incompatible with the control structure you have. I believe you have made both those mistakes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!