In this video I review how to declare and initialize a String variable. I also review a few of the basic methods associated with Strings such as length, charAt, and equals.
Note: I am putting these here because students have asked them in the past, this is not a reflection of what will be on quizzes.
A: I tend to intialize my variables as soon as possible without splitting it into more than one line, unless I have a good reason not to but it depends on how you are going to use the String later, there may be times when you will want to declare the String without initializing or declare all of your variables at the beginning of the program.
A: Private variables can only be accessed in the class they are created within, this protects them from being accidentally overwritten or used in other classes. Public variables can be accessed from any class. You can also have protected variables, which we will talk about later in this class.
A: Generally yes, though there are certain "escape characters" that can be used to add in things like new lines or other symbols that would be hard to type in.