Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Regarding function in java

  1. #1
    Junior Member vanshika's Avatar
    Join Date
    Apr 2013
    Location
    India
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Regarding function in java

    Is it possible in java not to give the function name and still call it?
    vanshika..


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Regarding function in java

    Can you give an example of a java method that you are asking about.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member vanshika's Avatar
    Join Date
    Apr 2013
    Location
    India
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Regarding function in java

    this is a question asked in an interview..Now i got the answer.
    Here it is:We have the concept of "Anonymous Class" in java i.e a class without a name or we can declare and instantiate a class at the same time.They are like local classes except that they do not have name.

    Now, Anonymous function is a function which is declared and called but without a name. In most of the programming languages,anonymous function have been used with the keyword lambda and that is why they are also known as lambda functions.
    Programming languages that support anonymous functions are: LISP,JavaScript,Ruby,etc.
    Java does not contain this feature.However,Java8 is planning to contain this feature.
    And we can call the anonymous function by passing it into a variable and call it.
    vanshika..

Similar Threads

  1. Java, EXSLT and custom function
    By Onyxdragun in forum Java Theory & Questions
    Replies: 0
    Last Post: March 25th, 2013, 03:24 PM
  2. Java function like php include
    By childoffred in forum Java Theory & Questions
    Replies: 4
    Last Post: April 20th, 2012, 04:21 PM
  3. Java - URL connection accessing Java Scrpit Function
    By virtual void in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 7th, 2010, 11:38 AM
  4. Replies: 1
    Last Post: August 7th, 2008, 02:09 AM