Results 1 to 3 of 3
  1. #1
    ohad is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default can somebody help me ?

    I don't know why cant I write functions in java, its says:Illegal modifier for parameter f; only final is permitted

    package matala2;

    public class fun {

    public static void main(String[] args) {
    // TODO Auto-generated method stub
    public static int f(int fa){

    }
    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: can somebody help me ?

    Methods can not be defined inside of other methods. Move the method named: f outside of the {}s that wrap the code for the main() method.

    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    ohad is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •