Results 1 to 9 of 9
Like Tree2Likes
  • 2 Post By Tolls

Thread: Some help with Java?

  1. #1
    proboundz is offline Member
    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0

    Question Some help with Java?

    Hey there :D
    Ok, so I am new to Java and I am a total noob. I have a few noobish questions too.

    1) What is wrong with this program?

    public class hello
    {
    for (inti=0;i<5;i++)
    {
    return dfssdfds;
    }
    }

    As you can see, I am a total douche and this is the first program I have attempted to write by my myself...and I got 10 errors....

    2) What is method? Explain like you would to a 9 year old. Why do we use it? What is the parameter?

    3) What is a good idp for a beginner.

    4)When do we use private and when do we use public.

    5) When do we use super for inheritance?

    I am taking the AP course this year and we have reached class inheritance.
    Thank you for putting up with me..

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,838
    Rep Power
    19

    Default Re: Some help with Java?

    1) What errors and where do they occur?

    As for the rest, what do you think the answers are?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    proboundz is offline Member
    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0

    Default Re: Some help with Java?

    1)Almost all of them occur in the condition: ; expected, identifier,illegal start of data....
    2)If I knew the answers, I wouldn't be here would I...

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Some help with Java?

    Quote Originally Posted by proboundz View Post
    1)Almost all of them occur in the condition: ; expected, identifier,illegal start of data....
    It looks like you've got code that needs to be inside of a method outside of a method or constructor. Where's your main method for one?

    2)If I knew the answers, I wouldn't be here would I...
    We're not here to do your class work for you, and you should look up the answers to these questions first. Then if you have questions about the information that you've looked up come on back and ask for clarification.

  5. #5
    proboundz is offline Member
    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0

    Default Re: Some help with Java?

    This is not class work. I genuinely don't understand. However since you are going to be fussy.

    2) I don't understand what a (main) method is
    3)*opinion question*
    4)Public if you want to share the data with another class
    5)To import private data from a main class to a sub-class

    The reason I came here is as I need somebody to simplify it for me. I have reached almost 1/3 of the course and yet I do not understand what a method is. I have searched but the definitions do not help me.



    It looks like you've got code that needs to be inside of a method outside of a method or constructor. Where's your main method for one?
    As a result, I do not comprehend what you mean.

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,838
    Rep Power
    19

    Default Re: Some help with Java?

    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    proboundz is offline Member
    Join Date
    Nov 2012
    Posts
    13
    Rep Power
    0

    Default Re: Some help with Java?

    Sorry I meant ide like netbeans.

    Thank you for your help.

  8. #8
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,838
    Rep Power
    19

    Default Re: Some help with Java?

    Notepad++ and use the command line to compile, at least for your first few basic apps.
    That way you'll at least know what a classpath is.
    Fubarable and DarrylBurke like this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Some help with Java?

    Quote Originally Posted by Tolls View Post
    Notepad++ and use the command line to compile, at least for your first few basic apps.
    That way you'll at least know what a classpath is.
    It also has a much smaller footprint then the huge popular IDE's such as NetBeans and Eclipse. For quick and dirty, I still use NotePad++.

Posting Permissions

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