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

All 2 Replies

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 meeting, networking, learning, and sharing knowledge.