Shuta Shuta - 1 year ago 117
Java Question

Consecutive run programming

I want to show the sentence "Hello" that is after finish process of


  1. input name and it's correct,

  2. ask age, and

  3. correct going to sentence "booting up"

which means I want to run method consecutively.

I only could run main method and not to be able to show the sentence "Hello".

How could I fix this problem?

enter image description here

Answer Source

I believe what you want to do is call the hello method at the end of your main method. Also you are missing a } after System.out.println("Hello");

Something like this:

public class YourClassName {
    public static void main (String [] theArgs){
        //your code here ....
    public static void Hello(){

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download