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...
Type: Posts; User: geoinfoguide
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...
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>>...
It would be good, but it is not necessary. Now I just need advice on how to add one backpack to another
Yes, I'd like to have only nest one deep.
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.
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...
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...
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 =...
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,...
I made a constructor in class Thing:
public Thing(Backpack small) {
this.small = small;
}
and a method in class 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...