Search:

Type: Posts; User: zemiak

Search: Search took 0.22 seconds.

  1. Re: [Beginner] How to add a new object to an object array?

    after start arr.length is 0, then can't do
    if (arr[0] == null)
    because [0] doesn't exist

    countElements can't be static in situation of two sets with different length



    public boolean...
  2. Replies
    3
    Views
    187

    [SOLVED] Re: Looking for a second opinion

    Hiding informations is not about speed, it's about
    . maintaining a large projects,
    it is easier to rewrite or change part of code if not direct depending on others parts.
    change probably does not...
  3. Replies
    3
    Views
    187

    [SOLVED] Re: Looking for a second opinion

    also it is possible to store temporary results to array
    and print it in separated method or in main()
    but this is more demonstrative



    import java.util.Scanner;

    public class RecursionPower...
  4. Thread: Do - While Loop

    by zemiak
    Replies
    1
    Views
    162

    Re: Do - While Loop

    this code works as I expect and ends after 0.
    What you have in main() ?
  5. Re: Multiple selection (bounding boxes) in displayed image

    Java is not Javascript
  6. Replies
    1
    Views
    214

    Re: Need help in making simple java program

    add your code here
  7. Re: Multiple selection (bounding boxes) in displayed image

    this is Java forum
  8. Replies
    1
    Views
    150

    Re: Java FX problem with Rectangle Intersects

    look if intetsects() is true after moveDOWN()
    and if move down snd up works in this situation, because result is stop move
    look at loop where check() is called if its condition is still true
    do...
  9. Replies
    1
    Views
    146

    Re: Learning java (beginner) - code error

    there is no attachments, copy your code and error message here
  10. Re: Main.java expects Person.java behavior to work. How can I solve this?

    what is in Main ?
  11. Re: Got problem calling method from inherited aggregation

    SiteEntry.browseInfo can't be static in



    class SiteEntry extends BrowseAction implements CommonStat {
    private static BrowseInfo browserInfo;


    for understand it try this simple...
  12. Replies
    3
    Views
    320

    Re: Make a constructor

    split the code into sections



    public class Pizza {
    some common variables

    Pizza() { }

    Pizza(String size) { }
  13. Replies
    3
    Views
    299

    Re: How to create a .java file?

    try rename command in the menu on the tab and check filename, be sure there is .java extension
    this is ok:
    https://onlinegdb.com/H17A9EIHO
  14. Re: I need help deleting a line of code after it has been selected by the user.

    simple solution for one method() (no OOP engine)
    it is not very clear in more complex scenarios


    boolean guardBarracksGold = true; //gold in room

    public void guardBarracks() {
    ...
  15. Re: can you please run this code and tell me the result?

    Think again about this time numbers, what exactly it means :

    speed..check_at
    20....... 0:00 pm start, with 20 mph
    30....... 2:00 pm speed changed at
    10....... 6:00 pm speed changed at...
  16. Replies
    10
    Views
    483

    Re: Need help SORTING AN ARRAY

    another way is using standard Java API


    import java.util.Arrays;
    import java.util.Comparator;
    ...
    Arrays.sort(runners,
    Comparator.nullsLast(
    Comparator.comparing(Runner ->...
  17. Thread: TicTacToe error

    by zemiak
    Replies
    7
    Views
    424

    Re: TicTacToe error

    in class Board change:

    //this.setLayout(new GridLayout());
    this.setLayout(new GridLayout(rows, columns));
  18. Re: Problem with option scanner input for a switch statement

    + add bloodtype initialization before return it eg in switch default:
    default:
    bloodtype = "";
  19. Replies
    17
    Views
    458

    Re: Trouble with outputs

    I found this:

    - here you forget brackets {} !! about line 150
    (without it upgradeCost=0)
    - and Calculations for Trip report must be before you print it with displayTripReport()
    so...
  20. Replies
    3
    Views
    399

    [SOLVED] Re: Logical Flaw HELP!

    String Streams=""; //=""

    public void InputStream() {
    ...

    if (answer==1) {
    Streams="Science";
    } else if(answer==2) { //else
    Streams="Arts";
    } else {
  21. Replies
    4
    Views
    441

    Re: Switch doesn't work properly

    your code is Javascript, and this forum is for Java language
Results 1 to 21 of 21