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

Thread: Creating a Gun in Java, I'm completely lost.

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

    Default Creating a Gun in Java, I'm completely lost.

    Hi all, I'm a student currently learning Java and I have an assignment I am extremely stuck with. We haven't done much programming before so I'm finding it tough but I have to provide the code for a Gun. Here is what I have so far:

    {
            int currentChamber;
            boolean [] chamberArray;
     
            public Gun()
            {
                chamberArray[0] = false;
                chamberArray[1] = false;
                chamberArray[2] = false;
                chamberArray[3] = false;
                chamberArray[4] = false;
            };
     
            void RotateCylinder()   
            {
     
            }
     
            void InsertBullet()
            {
     
            }
        }

    I'm struggling to get ANYTHING working for the two methods. Can anyone please help?


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,607
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: Creating a Gun in Java, I'm completely lost.

    You don't even specify what those methods are supposed to do. Write out a detailed summary of each method and what they're supposed to do, and you'll have a nice starting point.

    I recommend you read the link on asking smart questions from my signature, and this: Starting Writing a Program
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Completely lost, creating a bar graph
    By lairel in forum Object Oriented Programming
    Replies: 1
    Last Post: February 28th, 2011, 07:18 AM
  2. School java project, completely stuck
    By John1818 in forum Java Theory & Questions
    Replies: 0
    Last Post: November 18th, 2010, 04:10 AM
  3. Completely Lost in this problem(multiple methods)
    By wacarter in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 31st, 2010, 05:44 PM
  4. please could you help me with this java problem im very lost
    By eyeore in forum Java Theory & Questions
    Replies: 4
    Last Post: September 7th, 2009, 10:19 AM
  5. Completely New to Java
    By slimshadie in forum Java Theory & Questions
    Replies: 7
    Last Post: September 6th, 2009, 02:55 PM