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: Public static void (String[] args)

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Public static void (String[] args)

    Heya folks!

    I've recently started learning java because i'd like to create my own games, i'll stay here until i have mastered the ways of java (which will probaly be a very long time) I already have prior Lua exprience. This is my very very first code, i know it probaly looks horrible to all you advanced java coders. Oh well, here i go.

    class helo {
    	public static void main(String[] args) {
    	bob = Bob();
    	bob.speedUp(10);
            bob.printStates();
    	}
    }

    I'm expecting it to print out 10. Why isn't this happening?

    Thanks in advance.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,813
    My Mood
    Mellow
    Thanks
    177
    Thanked 627 Times in 614 Posts

    Default Re: Public static void (String[] args)

    Welcome to the forum!

    By convention, Java class names are capitalized.

    Your expectations are not yet aligned with Java reality. What does the program do or what does the compiler report when you try to compile and/or run the program? Post any compiler errors that you want help with.

    What guide or tutorial are you using to study Java?

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,298
    My Mood
    Hungover
    Thanks
    142
    Thanked 620 Times in 531 Posts

    Default Re: Public static void (String[] args)

    What happens instead?

    You haven't posted the code for the Bob class, so it's pretty hard to tell you what's going on.

    Also, you should really follow the Java naming conventions (classes start with an upper-case letter, methods and variables with a lowercase letter) and formatting (indent the code inside a method).
    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. Calling A Public Static Void Method from Main
    By Clubs in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 27th, 2013, 02:29 AM
  2. Why main(String args[]) method needs to be public?
    By rohan22 in forum Java Theory & Questions
    Replies: 11
    Last Post: December 7th, 2011, 10:41 PM
  3. public static void main(NewMember Mr_Bukkake){ }
    By Mr. Bukkake in forum Member Introductions
    Replies: 2
    Last Post: October 13th, 2011, 07:29 AM
  4. Calling a void method into a static void main within same class
    By sketch_flygirl in forum Object Oriented Programming
    Replies: 3
    Last Post: November 15th, 2009, 04:24 PM