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

how i call this thing to my main class  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how i call this method on my main??


this to ?how i call this on main ? i have search on google i have try everything but nothing
 
Carey Brown
Bartender
Posts: 2979
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


ekte spiriopoulos wrote:

There are a few issues:
  • "New" is a VERY poor choice for a class name. It may be mistaken for the keyword "new".
  • "array []f" probably won't compile unless "array" is a class name, in which case it should start with an upper case letter, and "array" would be a poor choice of class name leading one to ask "an array of what?". Maybe what you intended was "MyClass[] f".
  • The for() loop for an array is typically written like this
  •  
    Les Morgan
    Rancher
    Posts: 768
    19
    C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte,

    on the bubble sort there is a signature for the method of "void BubbleSort int[]", so there is no return value to catch and you must pass it an array of int

    for your sequential search you have a signature of "int seqSearch array String" so you must catch a return value of int and call the method with arguements of type array and String

    Les

    ekte spiriopoulos wrote:how i call this method on my main??


    this to ?how i call this on main ? i have search on google i have try everything but nothing
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:

    ekte spiriopoulos wrote:

    There are a few issues:
  • "New" is a VERY poor choice for a class name. It may be mistaken for the keyword "new".
  • "array []f" probably won't compile unless "array" is a class name, in which case it should start with an upper case letter, and "array" would be a poor choice of class name leading one to ask "an array of what?". Maybe what you intended was "MyClass[] f".
  • The for() loop for an array is typically written like this



  • I write it but the same
    New.BubbleSort(int i,int j);
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte spiriopoulos wrote:I write it but the same
    New.BubbleSort(int i,int j);

    Sorry, seem to be having a language barrier.
    The "same" what?
    Why did you call BubbleSort in that manor? Your sort take an int array as an argument, not two separate int's.
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:
    ekte spiriopoulos wrote:I write it but the same
    New.BubbleSort(int i,int j);

    Sorry, seem to be having a language barrier.
    The "same" what?
    Why did you call BubbleSort in that manor? Your sort take an int array as an argument, not two separate int's.
    what i should write for calling it ? i delete void on the bubble
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    For this to work you have to have created an int array called "someIntArray", and have also filled the array with some meaningful data. Example:

     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:For this to work you have to have created an int array called "someIntArray", and have also filled the array with some meaningful data. Example:


    i did it exactly but on my code on the last line of bubble it says
    and it is mistake as it says from left .I mouse it and it says''incompatibles types:missing return value''
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    At this point I'm not sure that I've tracked all the changes you've made. Would you please re-post all of your code again. Thanks.
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:At this point I'm not sure that I've tracked all the changes you've made. Would you please re-post all of your code again. Thanks.
    and in the main New.BubbleSort(call);
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You posted part of the class containing BubbleSort. Please post the entire class as well as the entire class containing main().
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I don't see anything wrong with your BubbleSort() method. If you are getting a compile error then cut and past the complete error message into a post.
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:I don't see anything wrong with your BubbleSort() method. If you are getting a compile error then cut and past the complete error message into a post.
    on my main i make it mouse on the left it says : cannot find symbol
    symbol : variable call
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte spiriopoulos wrote:
    Carey Brown wrote:I don't see anything wrong with your BubbleSort() method. If you are getting a compile error then cut and past the complete error message into a post.
    on my main i make it mouse on the left it says : cannot find symbol
    symbol : variable call

    Still need to see the class that contains main().
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte spiriopoulos wrote:
    Carey Brown wrote:I don't see anything wrong with your BubbleSort() method. If you are getting a compile error then cut and past the complete error message into a post.
    on my main i make it mouse on the left it says : cannot find symbol
    symbol : variable call
    but all is false i dont know why
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:You posted part of the class containing BubbleSort. Please post the entire class as well as the entire class containing main().
    i havent anything in main only this i try to call
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte spiriopoulos wrote:
    ekte spiriopoulos wrote:
    Carey Brown wrote:I don't see anything wrong with your BubbleSort() method. If you are getting a compile error then cut and past the complete error message into a post.
    on my main i make it mouse on the left it says : cannot find symbol
    symbol : variable call
    but all is false i dont know why
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
  • On line 1 you haven't provided a class name.
  • On line 31 you are only passing in one argument where, on line 2, you require 4 arguments.
  • On line 31 you use a variable name "call" but don't declare it anywhere, at least, not in the code you've shown us.

  •  
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte spiriopoulos wrote:
    ekte spiriopoulos wrote:
    ekte spiriopoulos wrote:
    Carey Brown wrote:I don't see anything wrong with your BubbleSort() method. If you are getting a compile error then cut and past the complete error message into a post.
    on my main i make it mouse on the left it says : cannot find symbol
    symbol : variable call
    but all is false i dont know why
    On line 31 you are only passing in one argument where, on line 2, you require 4 arguments : i making binary search
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    You have to define "call" before you use it. Lines 1 and 3 are reversed.
    "f" is not a descriptive name.
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:
    You have to define "call" before you use it. Lines 1 and 3 are reversed.
    "f" is not a descriptive name.
    You mean like the return position; could you give me an easy example?
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You mean like the return position; could you give me an easy example?

    I'm not sure why you have the two parameters "first" and "last". If you are always going to search the entire array you can code them, inside of binSearch, to be
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:
    You mean like the return position; could you give me an easy example?

    I'm not sure why you have the two parameters "first" and "last". If you are always going to search the entire array you can code them, inside of binSearch, to be
    i appreciate your help. You help me too much thanks a lot
     
    Carey Brown
    Bartender
    Posts: 2979
    46
    Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I might suggest going through some online tutorials on methods. Google: java methods tutorial
    Here's one I found
    http://tutorials.jenkov.com/java/methods.html
     
    ekte spiriopoulos
    Ranch Hand
    Posts: 217
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Carey Brown wrote:I might suggest going through some online tutorials on methods. Google: java methods tutorial
    Here's one I found
    http://tutorials.jenkov.com/java/methods.html
    how can i using UserInput.getString() this method to fill the call[] with random strings?
     
    Les Morgan
    Rancher
    Posts: 768
    19
    C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ekte,
    you have just received a ton of help and you know nothing more than before you first asked, that is apparent from your code. I seriously doubt anyone can help you until you take the advice already given you to study the tutorials. You need to help yourself enough to get you to the point where you can understand what is being done, and said, by the others to help you. At this point you don't have the expertise to be able to helped in what you are asking. Please follow the others advice and study the tutorials.
    Les
    ekte spiriopoulos wrote:
    Carey Brown wrote:I might suggest going through some online tutorials on methods. Google: java methods tutorial
    Here's one I found
    http://tutorials.jenkov.com/java/methods.html
    how can i using UserInput.getString() this method to fill the call[] with random strings?
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!