i'd like to change my code from procedural to OOP and i've got a problem when it comes to
naming methods. can somebody explain to me what's wrong with this -

sort.java:36: ';' expected
public static int sortAscending () {

- i understand that semicolon is not needed

sort.java:36: illegal start of expression
public static int sortAscending () {

Recommended Answers

Show a little more. The problem is most likely just before this line.

Jump to Post

All 2 Replies

Show a little more. The problem is most likely just before this line.

When you get "illegal start of expression" error, it can be from many reasons. Even though it could be missing semi-colon from the previous line, often time the reason is from mismatch of curly bracket ({ and }) or parenthesis (( and )) pair from lines above the error line. As pritaeas said, you need to show more, especially all code lines above the line number you stated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.