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 7 of 7

Thread: what is "SUCCESS" in method

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default what is "SUCCESS" in method

    Hi guys!
    I have some classes that i have to write javadocs to. So, there are some methods that return success, like:

    public string do smth(){
     
    if () {return SUCCESS;}
    else {return (something else, in this case some INPUT);}
     
    }

    What is this SUCCESS and INPUT? They are not variables, for no such variables were initialized. Is success something similar to true? By the method type it should be a string, but such string wasnt initialized, so im confused, please help.

    Sorry if i posted this in some wrong place.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: what is "SUCCESS" in method

    Is that pseudo code?
    The symbol: SUCCESS is not part of java like true is.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: what is "SUCCESS" in method

    Judging from the naming convention I would say they are static final variables of type String (or null).

  4. #4
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: what is "SUCCESS" in method

    Yes, that was pseudo code. Problem is that i cant use the ctrl+hover mouse over methods or fields, because i am viewing the project via separete .java files. I guess SUCCESS and INPUT really are some final Strings declared in some of the inherited classes, like Cornix suggested.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: what is "SUCCESS" in method

    pseudo code would mean to me that there isn't a real definition for the parts in the code. That's what pseudo means: "something like this".
    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: what is "SUCCESS" in method

    Yes, that is what i meant. There was some irrelevant code , and then the return SUCCESS;

    Now i am certain that SUCCESS is a string, because in some String.format it was adressed as '%s'

  7. #7
    Junior Member codepoet's Avatar
    Join Date
    Jul 2014
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: what is "SUCCESS" in method

    HI! May I ask if your class is EXTENDING THE ACTION Interface? If so, SUCCESS, INPUT, etc. are CONSTANT values which represents a corresponding string value. I'm using this when doing a Struts2 project.

Similar Threads

  1. Understanding layers of system logic. Clarity for what "SDK" & "JDK" mean
    By MilkWetGhost in forum Java Theory & Questions
    Replies: 1
    Last Post: October 3rd, 2013, 12:25 PM
  2. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  3. Replies: 3
    Last Post: December 7th, 2011, 02:03 AM
  4. Replies: 7
    Last Post: August 13th, 2011, 01:22 AM
  5. "Static method cannot hide instance method from implemented Interface"
    By Gthoma2 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: June 21st, 2011, 03:03 AM

Tags for this Thread