Search:

Type: Posts; User: javapenguin

Search: Search took 0.11 seconds.

  1. Re: Waddle the Java Jedi Penguin needs help with assignment.

    I fixed the problem. I now know what to do. I figured it out.

    private String name;

    public void setMethod(String name2)
    {
    name = name2;
    }

    public String getMethod ()
  2. Re: Waddle the Java Jedi Penguin needs help with assignment.

    private String color;

    public void setColor (String color2)
    {

    String color3;

    if (color2.equals("White"))
    color3 = "White";
  3. Re: Waddle the Java Jedi Penguin needs help with assignment.

    Ok. Can I just call the setMethod? If I can, how do I get the value I set it to out of there so I can return it in the getMethod?

    It would be for the best if I had both get and set methods,...
  4. Re: Waddle the Java Jedi Penguin needs help with assignment.

    Ok, so how do you do it then?

    I want to be able to set it and return it. Can I just combine them?

    That might be problematic as I call the setMethods and pass them parameters in the test...
  5. Re: Waddle the Java Jedi Penguin needs help with assignment.

    Can you use a have a getMethod call a void setMethod and set a value in the get method to the called setMethod like this:

    setMethod()
    {

    }

    getMethod{

    dataType value = setMethod();
  6. Re: Waddle the Java Jedi Penguin needs help with assignment.

    For strings, if you have the user enter a value, can you say something like

    if (userInput == "C" || userInput == "c")

    or must you use the

    if (userInput.equals("C") || userInput.equals("c")...
  7. Re: Waddle the Java Jedi Penguin needs help with assignment.

    oh, so I define the ints outside of it. If I do that, will it lose the values, even if the ints are defined outside, when it exits the
    {}? I actually thought it might be that, but I was wondering...
  8. Re: Waddle the Java Jedi Penguin needs help with assignment.

    I know it's losing scope. I just don't know why. Probably the try/catch blocks, but I thought I took care of that.
  9. Re: Waddle the Java Jedi Penguin needs help with assignment.

    Like


    x cannot be resolved
    y cannot be resolved


    Could be glitches in my try/catch blocks and their accompanying while loops.
  10. Re: Waddle the Java Jedi Penguin needs help with assignment.

    Why can't it find most of my x and y variables?
    It's copy and paste, so what's wrong with the first set will be wrong with all, or most, of them.

    I fixed the duplicate program beginning stuff, I...
  11. Re: Waddle the Java Jedi Penguin needs help with assignment.

    import java.util.*;
    import java.io.*;

    // This program will ask the user to choose a chess piece. Either a King, 'G' or 'g',
    // a Rook, 'R' or 'r', a Bishop, 'B' or 'b', a Knight, 'K' or 'k', a...
  12. Re: Waddle the Java Jedi Penguin needs help with assignment.

    No idea how to check if something is blocking the way. Only knights can jump over stuff in the way. But I don't have to do that. Just be able to choose which piece it is, its color, its current...
  13. Waddle the Java Jedi Penguin needs help with assignment.

    I need to make some sort of algorithm for chess pieces. I need a king, which can move 1 square in any direction. I need a knight which can move one square forward, though forward is defined...
Results 1 to 13 of 13