-1

missing method body, or declare abstract error in java.!! any help?

public class PhraseOMatic {

    public static void main(String[] args) {
        String[] wordListOne = {"come", "are", "let", "let's"};
        String[] wordListTwo = {"to", "you", "it", "hang"};
        String[] wordListThree = {"me", "there", "survive", "out"};

        int oneLength = wordListOne.length;
        int twoLength = wordListTwo.length;
        int threeLength = wordListThree.length;

        int rand1 = (int) (Math.random() * oneLength);
        int rand2 = (int) (Math.random() * twoLength);
        int rand3 = (int) (Math.random() * threeLength);

        String phrase = wordListOne[rand1] + " " + wordListTwo[rand2] + " " + wordListThree[rand3];
        System.out.println("What we need is a :" + phrase);
    }
}

missing method body, or declare abstract error in java.!! any help?

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
pintoo
  • 11
  • 1
  • 4

1 Answers1

3

Yes, remove the ; at the end of your main prototype line (first line). The compiler thinks that you want to declare it as abstractand you forgot the abstract keyword.

AhmadWabbi
  • 2,253
  • 1
  • 20
  • 35