Stephan van Hulst wrote:In integral types, the number of bits determines the length of the range of numbers you can save.
In floating point types, the number of bits determines the maximum precision of numbers you can save.
In short, double gives you less rounding error than float.
Campbell Ritchie wrote:. . . This is what you started off with:- . . .And this is my corrupted version:- . . . If you are doing arithmetic with + in the same line as String concatenation, put () round the arithmetic. . . . .
Campbell Ritchie wrote:Delete lines 9‑12. Use the .length fields throughout, or array1.length + array2.length for the total.
Dave Tolls wrote:num_of_Toppings is the total of one and two (7 in this case).
Consequently when you use it to generate the index to use for the arrays it has a pretty high chance of producing a number that's too large.
Campbell Ritchie wrote:Head First Java? Even at fifteen years old, it is probably my favourite beginners' book. Don't try to run anything on objects from the Party class.
SDK is an old name for the JDK; the version numbers show that you have successfully run Java8. If you want Java13, try the following instruction at the command line, but I have probably got some of the folder names wrong:-Beware: code compiled with Java13 won't usually run on older versions.
Don't use MS notepad, but download Notepad++, a much better app. The video showed Notepad++ (a good thing) but it wasn't named clearly.
Campbell Ritchie wrote:Please show us what happens when you execute these two commands:-That tutorial is no better than many on YouTube; I can see several things I am not happy about:-
1: It is out of date, using Java6 and Win7. On Win10 you have to create a separate PATH entry in a separate line for each program you want to run. 2: He is creating a user Path; I think it would be better to add the PATH to Java® to the beginning of the existing system PATH. 3: He calls the long error message after writing javac “crap”. It isn't crap at all. 4: The Java® code is incorrectly indented. 5: It is poor style to have  after “args”. The  belong after “String”. 6: It is poor style to have an xyz.java file and a class name starting with a lower‑case letter. 7: I would prefer to have the \Java folder elsewhere than the root of a drive. 8: He neither explains what he is doing with the PATH, nor that the installation window shows the correct PATH to add. See that video at 2′ 41″.If you are running Java11+, you can delete the xyz.class file and run your code by writing java Greetings.java Remember to give the class name a capital G.
The idea of the PATH is that it guides the OS where to find the programs called javac and java; they are both in the same PATH. It looks through all the PATH entries in order until it finds a program matching the requested name, e.g. java.