Java Programming 1 - Chapter 8 Exercises (1, 2, & 6) - Spring 2021

preview_player
Показать описание
Recorded during a live class session. Based on the 11th edition of the Daniel Liang text "Introduction to Java Programming". Exercises 1, 2, and 6.
Рекомендации по теме
Комментарии
Автор

This example shows hard info that is already there. What about user info? Where I struggle is when I'm supposed to pass arguments to the new object for a constructor, but I haven't gotten the info from the user yet. So what to pass if args are still empty? How to declare Class array = new Class[5] as a new array, and then inside a for loop: array[x] = new Class(arg1, arg2), BEFORE you get the info from the user? You can't assign info via setters to to obj unless you create it first. I've been commenting out all the constructors because I don't understand and the reading in the book doesn't explain it. I don't see the point in even having a constructor if you have to get user info and set the info that way.

bridgettedunn