• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nothing happens when I run my program  RSS feed

 
Andrew McCarthy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made another like the Dog program, called MovieTestDrive.java
However, after I compiled it (with no errors, i might add), I entered the run command and nothing happened. Did I do something wrong?



I am using a mac, and I use terminal to compile and run programs.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What did you expect to happen? Did the program hang? Just not produce any output before returning to the command prompt? Please be explicit in your description.

I suspect you expected some output, but nowhere in your main method do you do anything to produce output.
 
Andrew McCarthy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help. The problem is that nothing happens when I attempt to run the program. There should be some sort of output, but there isn't.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew McCarthy wrote:There should be some sort of output, but there isn't.

No. There is nothing in your main method that will cause output to occur.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew McCarthy wrote:Thank you for your help. The problem is that nothing happens when I attempt to run the program. There should be some sort of output, but there isn't.


What sort of output did you expect? The program, as written, should not have any output.

Henry
 
Andrew McCarthy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I see. I'm sorry, I'm still very new to this, and it still hasn't really clicked. I'll go back through the program and see what I can do.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
 
BalaMurali dhar
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not using System.out.println to print the statement & give the output
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The details are critically important. When you ask a question, you are asking people to give up their time to help you. People here LOVE to help others, so that's not a problem. But you should do everything you can to make it easy for them to help you. If it is too hard, folks will say "My time would be better spend helping someone else".

So, it is important that you tell us what did happen. Did you get an error? Did the program hang - i.e. it never came back with a new "C:\"? did it come back to the prompt but not show any output? If you were expecting output, what would you expect it to be?

If you do get an error message, please post the complete and exact text - don't just say "i got an error when i compiled", but post the text of what that error says.

You might want to consider (at minimum) skimming our FAQ on HowToAskQuestionsOnJavaRanch (<---that is a link) to get some ideas on the best way to use this site.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: You never "play" the Movie.

Keep plowing forward!

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