• Post Reply Bookmark Topic Watch Topic
  • New Topic

method to create and print a matrix with 3 rows and x number of columns  RSS feed

 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
any ideas why my code is not working (line 29)? I don't want to improve it, I just would like to get simple tips to why the matrix is not being printed out. I know my code is complicated and clumsy, I will improve it later :/
Many thanks

 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Graciete Silva wrote:any ideas why my code is not working (line 29)?

What do you mean by "not working"? Please provide more details.
Please read this.
 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pawel,

sorry, its my second post here, I'm still getting to learn the rules, thank you for the link.

In line29


I was expecting to call method tempCalendar to create the matrix inside the ReadMatriz to print it out.
That line of code is underlined red and this is what neatbeans tells me:



is it better like this?

In the meantime I've noticed some errors I had and corrected my original code:

   




May thanks
Graciete

 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code

This means you run a code that doesn't compile. Possibly using some Eclipse compiler? Don't do this. If it doesn't compile there is no point in running it.

Take a look at lines 19 and 29. Take a close look on method names. Character by character.
 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, I've seen the error in the names, corrected. Still it doesn't run, line 29 still underlined -- error: 'void' type not allowed here.
I don't understand, I'm calling a method that prints out something ....
thank you for your help.
 
Daniel Andres
Ranch Hand
Posts: 94
3
AngularJS C++ Chrome Eclipse IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Graciete Silva wrote:Hi Pawel,

sorry, its my second post here, I'm still getting to learn the rules, thank you for the link.

In line29


I was expecting to call method tempCalendar to create the matrix inside the ReadMatriz to print it out.
That line of code is underlined red and this is what neatbeans tells me:



is it better like this?

In the meantime I've noticed some errors I had and corrected my original code:

   




May thanks
Graciete



Hello
I am not an expert and I'm away from my computer at the moment so I'll give you a suggestion of what might be wrong with the code.

When you call ReadMatriz an argument is supposed to be passed onto that method but nothing is being returned when you call tempCalendar so that might be giving you an error message.
 
Daniel Andres
Ranch Hand
Posts: 94
3
AngularJS C++ Chrome Eclipse IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paweł Baczyński wrote:
Take a look at lines 19 and 29. Take a close look on method names. Character by character.


I just realized that my suggestion might have been too direct as far as helping. My apologies if that's the case.
 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Daniel,  readMatriz uses tempCalendar(31) as argument which calls the method tempCalendar to create a matrix with 3 rows and 31 columns.
This was my intention anyway ...
Java tells me is a void type and its not allowed there .. ?!?!
 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no, not at all. proof is I could not fix my code yet ...
 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, I just realized my tempCalendar method is not creating a matrix as I intended, dont know why ...
 
Knute Snortum
Sheriff
Posts: 4279
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paweł Baczyński wrote:Exception in thread "main" java.lang.RuntimeException: Uncompilable source code

This means you run a code that doesn't compile. Possibly using some Eclipse compiler? Don't do this. If it doesn't compile there is no point in running it.

Take a look at lines 19 and 29. Take a close look on method names. Character by character.

Read this post and do what it says please.
 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already did.

 
Graciete Silva
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, I found the problem
My tempCalendar method was creating the matrix but not storing it anywhere so I could not use it as an argument in the main.
Now it looks like this:



thanks for your help!

 
Daniel Andres
Ranch Hand
Posts: 94
3
AngularJS C++ Chrome Eclipse IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Graciete Silva wrote:ok, I found the problem
My tempCalendar method was creating the matrix but not storing it anywhere so I could not use it as an argument in the main.
Now it looks like this:



thanks for your help!



Awesome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!