Search:

Type: Posts; User: Norm

Page 1 of 20 1 2 3 4

Search: Search took 0.66 seconds.

  1. Thread: import question

    by Norm
    Replies
    3
    Views
    14

    Re: import question

    To allow the user to select which classes are to be used.
  2. Thread: import question

    by Norm
    Replies
    3
    Views
    14

    Re: import question

    No. I think of the import statement as an extension of the classpath. It tells the compiler where to look for class definitions. It does not cause more class files to be included in your class...
  3. Re: Entry level: 2 classes and Exception in thread "main"

    The Scanner class should be able to read most text files.
    I don't know what "typed in method cutCheck" means.
    You should be able to create the file to be read with any text editor.

    Try...
  4. Re: Help Needed In the Code: Occurrence of Digits in a Number

    Not sure what you think would be inefficient.
    Get the code to work first. Then if there is a problem change it.

    The main inefficiency problem with the code is all the variables instead of using...
  5. Thread: unsolved

    by Norm
    Replies
    5
    Views
    83

    Re: unsolved

    Please edit your post and wrap your code with code tags:


    YOUR CODE GOES HERE

    to get highlighting and preserve formatting.

    What have you tried?
    What specific questions do you have about...
  6. Re: Help Needed In the Code: Occurrence of Digits in a Number

    How about: theDigit1, theDigit2, etc
    and countOfDigit1, countOfDigit2, etc

    Back to pot#5 about this question: How do I omit the last 5 lines?
    What is there about those lines that the code can...
  7. Replies
    5
    Views
    82

    Re: New program error help

    Pass this to your favorite search engine: java equals method
  8. Thread: Helph me !

    by Norm
    Replies
    4
    Views
    102

    Re: Helph me !

    Are the digits in this String the positions you want: 87654321
    If those are the positions, how many bits does a value (say 1) have to be shifted left to get to position 1?
    How many to position 2?...
  9. Replies
    29
    Views
    194

    Re: Random Shape Generator

    How do you know if it is or not? Do you have a println statement in it that prints a message when it is called?

    What color is the Draw panel supposed to be? I see that the code sets the JPanel:...
  10. Replies
    5
    Views
    82

    Re: New program error help

    Use the equals() method to compare Strings.

    BTW:
    The compare for equals operator is ==
    The assignment operator is =
  11. Replies
    29
    Views
    194

    Re: Random Shape Generator

    Is the paintComponent() method being executed?
    Did you add the default: case?
  12. Replies
    29
    Views
    194

    Re: Random Shape Generator

    The code compiles for me. Make sure the Draw class has been compiled with the new source. Delete the Draw.class file to make sure.

    The default: case is still missing from the switch statement....
  13. Replies
    8
    Views
    102

    Re: java cant find my files

    Copy the full contents of the command prompt window and paste it here showing what you entered and what the OS said.

    To copy the contents of the command prompt window:
    Click on Icon in upper left...
  14. Replies
    5
    Views
    82

    Re: New program error help

    Please copy the full text of the error message and paste it here. It has important info about the error.

    Please edit your post and wrap your code with code tags:


    YOUR CODE GOES HERE

    to get...
  15. Replies
    29
    Views
    194

    Re: Random Shape Generator

    Yes, that looks like a no-arg constructor.


    The drawing of the shapes is done in the paintComponent() method. I'm not sure what you mean by "create" the shapes. The switch statement in the...
  16. Replies
    29
    Views
    194

    Re: Random Shape Generator

    Does the Draw class have a no-arg constructor?


    See the tutorial: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html


    Please describe what "it" is supposed to mean.
  17. Replies
    24
    Views
    188

    Re: Not sure where my problem is

    Use 0 as the starting index when searching from the first element to the last
    Use theArray.length-1 as the starting index when searching from the last element to the first
  18. Replies
    29
    Views
    194

    Re: Random Shape Generator

    Please copy and paste the current errors. There have been lots of them posted and I'm not sure which youy are talking about.

    ALSO: There should be a default: case in the switch statement that...
  19. Replies
    29
    Views
    194

    Re: Random Shape Generator

    Where is the no-arg constructor for the Draw class?
  20. Replies
    29
    Views
    194

    Re: Random Shape Generator

    The spelling of the constructor's name must match the class's name.

    What happened to the constructor that takes a color? A class can have many different constructors.
  21. Replies
    29
    Views
    194

    Re: Random Shape Generator

    Where is the draw() method defined in the draw class? The compiler can not find it.

    That is an example of why the naming conventions are helpful.
    There is draw a class and draw a method.
    It...
  22. Replies
    29
    Views
    194

    Re: Random Shape Generator

    That code looks like a no-arg constructor. Did you try it? What happened?

    Take a look at the tutorial: http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html
  23. Thread: someone help

    by Norm
    Replies
    3
    Views
    66

    Re: someone help

    You can only define a variable one time in the existing scope.
    You can reuse an existing variable as often as you want
    or you can change the name of the variable so it's different from the name of...
  24. Thread: someone help

    by Norm
    Replies
    3
    Views
    66

    Re: someone help

    Sorry, we don't do students work for them. We will help you get the code to work.

    If there are errors, copy the full text of the error messages and paste it here.
  25. Re: Entry level: 2 classes and Exception in thread "main"

    The Scanner class's nextLine() method called on line 21 did not find a line to read.
    Make sure there are enough lines in the file
    or use the Scanner class's hasNextLine() method to test for a line...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4