• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with arrays and methods  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, sorry for my english,I'm from Bosnia..
I was start learning Java before 2 months,and everything goes smooth except this lesson.
So I have problem with arrays and methods, I can't print array,when I call preuzmiNiz I get an error

 
Saloon Keeper
Posts: 3332
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When posting code please use "Code" tags. When you are preparing your post, highlight the code and then click on the "Code" button just above the editor window. I fixed it for you this time.

And welcome to the Ranch.
 
Senad Delic
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,sorry..
 
Carey Brown
Saloon Keeper
Posts: 3332
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you get an error message it helps us to help you if you can post (cut-n-paste) the entire message. Also your main() method does not declare 'array' so I'm assuming it is a class level variable. It would help if you could post the complete class.
 
Carey Brown
Saloon Keeper
Posts: 3332
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your parameter name of 'array' is misleading because you have declared it to be of type double, not an array of type double. If you really intended it to be an array then it should be written
Likewise, the method returns a double, not an array of doubles.
 
Senad Delic
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it,but thanks you ..
I didn't know just how to call preuzmiNiz in main method,that was a problem for me
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!