Results 1 to 3 of 3
  1. #1
    skaterboy987 is offline Member
    Join Date
    Sep 2011
    Posts
    56
    Rep Power
    0

    Default Subroutines in java? Yes or No?

    Can you do something like this:
    if (x == 1)
    {
    GoSub BlahBlahBlah (Goes to BlahBlahBlah)
    }


    BlahBlahBlah()
    System.out.println("Hi")

    Is there subroutines in java or something like them?

  2. #2
    Iron Lion is offline Senior Member
    Join Date
    Nov 2010
    Posts
    210
    Rep Power
    4

    Default Re: Subroutines in java? Yes or No?

    Yep. They're called methods.

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: Subroutines in java? Yes or No?

    Yes they are called methods in java.

    Defining Methods (The Java Tutorials > Learning the Java Language > Classes and Objects) this and the other tutorials in that section may be useful to you.

Posting Permissions

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