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

Thread: Java Methods - Beginner

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

    Default Java Methods - Beginner

    Hi I am new to Java and would like to ask how to do this question specifically:

    Code a Java method that accepts a String array and a String. The method should return true if the string can be found as an element of the array and false otherwise. Test your method by calling it from the main method which supplies its two parameters (no user input required). Use an array initialiser list to initialise the array you pass. Test thoroughly.


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: Java Methods - Beginner

    Read over this oracle tutorial, and tell me if it helps you get started: Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. #3
    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: Java Methods - Beginner

    Also posted at: Java Methods
    If you don't understand my answer, don't ignore it, ask a question.

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Java Methods - Beginner

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

Similar Threads

  1. Beginner Java question with Methods
    By Justin5609 in forum Object Oriented Programming
    Replies: 7
    Last Post: February 25th, 2014, 06:52 PM
  2. Affecting Point objects with methods - a beginner's failed attempt
    By thatolkevin in forum Object Oriented Programming
    Replies: 10
    Last Post: July 16th, 2013, 08:50 AM
  3. Why and where abstract methods & classes and static methods are used?
    By ajaysharma in forum Object Oriented Programming
    Replies: 7
    Last Post: July 14th, 2012, 01:16 AM
  4. Can I do this with methods in Java?
    By mjballa in forum Java Theory & Questions
    Replies: 2
    Last Post: February 4th, 2012, 08:55 PM
  5. [SOLVED] Java Beginner: Help with methods and returning values (hailstone program)
    By alf in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 14th, 2010, 06:28 PM