Search:

Type: Posts; User: camel-man

Search: Search took 0.28 seconds.

  1. Thread: BinaryTree

    by camel-man
    Replies
    5
    Views
    128

    Re: BinaryTree

    You need to make your methods static. ex.)static public void readFile(){
    .....
  2. Re: I think one class is over riding the other one?

    For testing purposes, when you run it and you see the frame empty, grab the corner of the frame and stretch it out to a larger size to see if the drawing appears. If it does then I might be able to...
  3. Thread: BinaryTree

    by camel-man
    Replies
    5
    Views
    128

    Re: BinaryTree

    Define " I am having trouble with trying to get the main method to work". What error messages do you get, if any?
  4. Replies
    4
    Views
    135

    [SOLVED] Re: Help with my simple Scanner program?

    Is this due to the newline('\0') being left in the buffer after the user enters in the int?
  5. Replies
    1
    Views
    95

    [SOLVED] Need guidance on adding characters

    Right now I have three stacks. Each stack holds characters, with the normal operations of pushing and popping. I am trying to compare two characters from stack1 and stack2(each character is a digit...
  6. Replies
    3
    Views
    91

    Re: Button not showing on panel?

    Thank you very much sir.
  7. Replies
    3
    Views
    91

    Button not showing on panel?

    I have three classes.. 1. panel class 2. frame class and 3. tester class

    I am creating the objects like so but when I add button to panel then panel to frame I am not seeing the button. here is my...
  8. Replies
    2
    Views
    134

    What is this declaration considered?

    When you say


    int array[];

    I know that this is declaring an array without a size. Does that mean that this is "Sort" of like a pointer. A slot in memory waiting for an address to fill its...
  9. Replies
    1
    Views
    125

    Cannot get rid of File Input error

    import java.util.Scanner;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.PrintWriter;

    public class CountryPopulationReverse{

    ...
  10. Replies
    4
    Views
    181

    Re: why wouldn't it print my code?

    Give an example of your input and what does it output
  11. Replies
    1
    Views
    243

    Re: Home work help?

    What have you done so far? You need to show a valiant effort, write down your outline of the program on paper if you need to get a start on it.
  12. Replies
    3
    Views
    306

    Re: int cannot be dereferenced

    it is referring to the integer being passed into the method, If you want to refer to the queue then you need to add the keyword "this"


    for (int i = 0; i < this.kassas.length; i++)
    {...
  13. Replies
    6
    Views
    308

    Re: Pls me out on this arrays number print

    You have your column and row numbers reversed.

    Columns should equal 6 and rows should equal 3
  14. Replies
    5
    Views
    270

    Re: How to validate user input in a loop

    Right, but I thought that it would then eventually reach the top of the while loop and then go back into the try statement.

    I ended up adding sc.next(); in the catch statement and now all is...
  15. Replies
    5
    Views
    270

    Re: How to validate user input in a loop

    Yes I tried a while loop like this, but whenever I enter in a double for example. It will go into an infinite loop saying "try again wrong type"



    int i=0;
    while(i<3)
    {
    try
    {
    ...
  16. Replies
    5
    Views
    270

    How to validate user input in a loop

    Is there a method that allows me to check if the user entered anything other than an integer. For example I want the user only to enter an integer, I have this code.




    try
    {
    ...
  17. Re: Beginner struggling with homework question

    First off you need to switch around your assignment statements. Your constructors purpose is to set the values of the object to that of the parameters passed to it.
  18. Replies
    6
    Views
    262

    Re: I need help developing an algorithm.

    i thought Java used Unicode?
  19. Replies
    4
    Views
    174

    Re: Not getting an output file

    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Unknown Source)
    at java.util.Scanner.next(Unknown Source)
    at java.util.Scanner.nextInt(Unknown Source)...
  20. Replies
    4
    Views
    174

    Not getting an output file

    For some reason I am not getting an output file created in eclipse when I run this program. I get this error when I run it.
    Exception in thread "main" java.util.InputMismatchException blah blah and...
  21. Replies
    3
    Views
    245

    [SOLVED] Re: Shuffling a deck of cards

    String[] shuffledDeck=standardDeck;
    I believe that this statement points shuffledDeck to standardDeck and therefore whatever changes in shuffled deck changes in standard. Notice how when you print...
  22. Replies
    1
    Views
    183

    try catch needed? Or recommended?

    I am just recently learning about exception handling and I have yet to come across an example where Try catch was the only way to handle the error. Everything else we have come across we could use...
  23. Replies
    1
    Views
    206

    Re: How do I make a break in this?

    at the bottom of your segment of code you can do this... Take out the print statements in your if statement blocks and add the printing code at the end.



    if (some1.equals(some2))
    print blah...
  24. Replies
    7
    Views
    213

    Re: Help with array

    First off you need to use the for loop before you make max=numbers[0];

    Pseudocode

    Prompt user to enter 5 numbers
    loop getting 5 inputs from the user
    calculate
  25. Replies
    9
    Views
    274

    Noob here forgive me(static question)

    I have a question about the key word static. Lets say for instance we have this piece of code.


    public class Foo
    {
    private int age;
    private static int weight;
    ..
    ...
    }
Results 1 to 25 of 25