Search:

Type: Posts; User: geoinfoguide

Search: Search took 0.09 seconds.

  1. Replies
    2
    Views
    809

    Re: Constructor & container

    Thanks for the answer.
    This is a part of the whole my exercise.
    The idea would be to use as much as possible existing elements from this exercise.
    I can do something like this:


    package...
  2. Replies
    2
    Views
    809

    Constructor & container

    I'd like to make working constructor creating a list filled with elements of the container.
    I have a program:


    import java.util.*;

    class Utils {

    public static <T extends Comparable<T>>...
  3. Re: How to put other backpack to main backpack?

    It would be good, but it is not necessary. Now I just need advice on how to add one backpack to another
  4. Re: How to put other backpack to main backpack?

    Yes, I'd like to have only nest one deep.
  5. Re: How to put other backpack to main backpack?

    Thanks for interesting;
    I'd like to place the backpack in another backpack...

    --- Update ---

    Yes, I'd like to only have a second backpack in the original backpack.
    That's all.
  6. Re: How to put other backpack to main backpack?

    I know how to put to the backpack some things,
    Backpack (0.1 kg, 0.5 l) with
    1: Ball (1.0 kg, 3.0 l)
    2: Torch (0.5 kg, 1.0 l)
    3: Box1 (5.0 kg, 25.0 l)
    Total: 6.6, 29.5

    I can create second...
  7. Re: How to put other backpack to main backpack?

    Backpack (0.1 kg, 0.5 l) with
    1: Ball (1 kg, 3 l)
    2: Box1 (5 kg, 25 l)
    3: Backpack (0.01 kg, 0.1 l) with
    1: Box2 (3 g, 8 l)
    2: Box3 (1 g, 4 l
    Total: 4.01 kg, 12.1 l
    Total: 10.1 kg...
  8. Re: How to put other backpack to main backpack?

    I'm still changing something in the code so I'd better paste it again. This is the last version.


    package Safe;

    import java.util.ArrayList;

    class TableSafe {

    ArrayList<Thing> item =...
  9. Re: How to put other backpack to main backpack?

    I've translated it wrong, sorry. The point is that the program returns the following response:

    Backpack (0.1 kg, 0.5 l) with
    1: Ball (1.0 kg, 3.0 l)
    2: Box1 (5.0 kg, 25.0 l)
    3: null (0.0 kg,...
  10. Re: How to put other backpack to main backpack?

    I made a constructor in class Thing:


    public Thing(Backpack small) {
    this.small = small;
    }


    and a method in class Backpack
  11. How to put other backpack to main backpack?

    I tryed to put some items to the backpack.
    I can add and remove some items, but I can't put another backpack in main backpack.

    After running the program I can see:
    backpack and some items...
Results 1 to 11 of 11