java - Error: insert enum identifier and enum body -


This is my code, both syntax errors are more specifically on line 16 "private getTotalGrains (k, grains);" By reading other similar questions, can there be something to write the method inside any other method? If I do not think there is enough experience to see it, then it will be amazing. Import java.util.Scanner; Public square grains {public static zero main (string [] args) {{grain = new grain (); Grain.getTotalGrains (); } Int grain = 0; Scanner Keyboard = New Scanner (System.in); System.out.println ("How many days the program will run? Enter the number between 1 and 64"); Int k = keyboard.nextInt (); Private Milltotalgrain (K, cereals); {K = K-1; Grain = grain * 2; Do {getTotalGrains (K, Grains); } While (k == 1); {System.out.println (grain + "grain of rice."); } While (K & lt; 1); {System.out.println ("Invalid number please try again."); } While (k> 64); {System.out.println ("Invalid number please try again."); }}}}}

First of all, there is nothing here

There are several syntax errors in your code, take a look at the following section.

  Private getTotalGrains (K, Grains); << code>  
  1. Return type is missing
  2. parameter types are missing
  3. after definition of method in ; is unnecessary

    It should be rewritten:

      Private zero getTotalGrains (int k, int grains) { < / Pre> 

    In addition to this, you try to define the method within getTotalGrains method main which is not supported by Java

    I think That there are other mistakes besides

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -