Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

control an array  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to check(control) if an array is have done already bubblesort.I did this:
is good? or not?
 
Carey Brown
Bartender
Posts: 2996
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Classic error:

This is identical to

What you probably intended was

But this is why it is the convention to write

without the "==true"
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if( Bubble.sort )I will replace this to the upper code and I will check the array if is sort or not ,right?
 
Junilu Lacar
Sheriff
Posts: 11153
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:i want to check(control) if an array is have done already bubblesort.I did this:
is good? or not?



Do you see why you need to format your code properly?
 
Junilu Lacar
Sheriff
Posts: 11153
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's really not that difficult to reformat your code to have proper indentation if you're using an IDE like Eclipse or IntelliJ IDEA.

In Eclipse, you just press Ctrl+Shift+F or ⇧⌘F (Shift+Cmd+F)

In IDEA, it's ⌥⌘L (Opt+Cmd+L) or Ctrl+Alt+L

In NetBeans, it's probably very similar although I don't use it so I wouldn't know off the top of my head what the shortcut is.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!