Search:

Type: Posts; User: Cornix

Page 1 of 20 1 2 3 4

Search: Search took 0.47 seconds.

  1. Re: Identical if statements behaving in different ways

    I would really advice you to learn about for-loops. They would cut down your code tremendously.
  2. Replies
    21
    Views
    192

    Re: Making a rectangle

    Thats what the Setters are for.
  3. Replies
    21
    Views
    192

    Re: Making a rectangle

    If you write:

    private Rectangle(int width, int length) {
    ...
    }
    Then the constructor has been declared "private" and can not be used by any other classes other then the Rectangle class.
    You can...
  4. Replies
    21
    Views
    192

    Re: Making a rectangle

    Your code is missing closing curly brackets. Whenever you open them you also have to close them later on.
    Besides that the error message is pretty much self-explanatory, is it not?
  5. Replies
    3
    Views
    103

    Re: Beginner question dealing with a GUI

    Or instead just a custom class extending JDialog if JOptionPane does not give you the flexibility you want.
  6. Replies
    21
    Views
    192

    Re: Making a rectangle

    We would just be repeating what all the other tutorials and textbooks say because the errors you make are so basic there is not much more to say about them. I dont feel like repeating textbooks.
  7. Replies
    21
    Views
    192

    Re: Making a rectangle

    You should really go over the basics once again before trying this program, there are countless errors in the program. Starting with misplaced semicolon and variables that have no type defined. You...
  8. Replies
    9
    Views
    131

    [SOLVED] Re: Nested 'If' Statements

    I dont even know why java allows stupid things like that. Sometimes one has to wonder what the people were thinking when they wrote the ruleset.
  9. Replies
    21
    Views
    192

    Re: Making a rectangle

    Setters and Getters are created for private member variables. You could google them to read more information on how these methods usually look like. A simple example would be:

    public class Coord {...
  10. Thread: Error in Main

    by Cornix
    Replies
    5
    Views
    84

    Re: Error in Main

    But the error message says something different. The IDE might highlight that because there might be a compile-time problem. However, your application crashed because of a runtime-problem, namely an...
  11. Thread: Error in Main

    by Cornix
    Replies
    5
    Views
    84

    Re: Error in Main

    The system cannot find the file specified. Is there anything unclear?
  12. Replies
    10
    Views
    74

    Re: Reusing an Entered List of Array Elements

    What do you want to use them for?
  13. Replies
    10
    Views
    74

    Re: Reusing an Entered List of Array Elements

    I am not going to read 50+ lines of code just to find that out. If the key is a string array, why are you not able to save it in a variable?
  14. Replies
    10
    Views
    74

    Re: Reusing an Entered List of Array Elements

    But what is it? A number? A string? A complex object with several attributes?
  15. Replies
    10
    Views
    74

    Re: Reusing an Entered List of Array Elements

    What exactly is this "key" you are talking about? Perhaps you should create a class for that or an interface.
  16. Replies
    10
    Views
    74

    Re: Reusing an Entered List of Array Elements

    If you want to save something use a variable.
  17. Thread: Java vs Groovy

    by Cornix
    Replies
    3
    Views
    87

    Re: Java vs Groovy

    As far as I know groovy code is translated into java byte-code before being interpreted, so everything possible with groovy should be possible with java too. Its just the different way to use it.
  18. Replies
    2
    Views
    86

    [SOLVED] Re: folder/object browsing menu in Java

    Read the API for the JTree class perhaps.
  19. Thread: Error in Main

    by Cornix
    Replies
    5
    Views
    84

    Re: Error in Main

    The error message is quite clear, it says it can not find a class called StateController.
  20. Replies
    6
    Views
    145

    Re: Sum of Powers using recursion

    Do not use the "--" operator when calling methods like that. The results will not be what you expect.
    Instead you should just use "n - 1" or "k - 1". The problem with the "--" operator is that it...
  21. Replies
    9
    Views
    153

    Re: Generating per person URL

    This is impossible. If you are dealing with students you have no way of making this happen. You can not control their computers, you can not monitor their houses. These little buggers will always...
  22. Replies
    14
    Views
    164

    Re: Not Sure Whats Wrong

    Yes exactly.
    You have 5 items in your array. You have your loop run from 0 to 3 which is 4 indices. But then you only check for the fourth item in your if-condition. This happens because the...
  23. Replies
    11
    Views
    95

    Re: pythagorean triples using a for loop

    Because it isnt.
    You have a value on the left hand side of the assignment operator, and a value on the right hand side.

    It is as if you would write "5 = 2 + 2". Its not an assignment, its not...
  24. Replies
    14
    Views
    164

    Re: Not Sure Whats Wrong

    The curly brackets { and } have a meaning in java. The way you use them is the source of your problem. You have misplaced the brackets for your loop and thus your program does not do what you would...
  25. Replies
    11
    Views
    95

    Re: pythagorean triples using a for loop

    Could you try to explain to us what you are trying to do in the erroneous line?
    Try to explain it step by step:

    Math.pow(hypotenuse,2)=Math.pow(side_1,2)+Math.pow (side_2,2);
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4