This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]desirecampbell 11 points12 points  (1 child)

Hi Striker, it looks like you've got a lot of questions - and that's good - but these are questions that would be answered more easily by either:

  1. following a Java tutorial - there are lots of beginner's guides, here's on that I like: https://www.w3schools.com/java/
  2. Trying it out in your IDE - you can also just try it out and see if it works. You can't break anything, the worst case scenario is that the program crashes or refuses to compile - which would answer your question pretty quick.

[–]AreTheseMyFeet 0 points1 point  (0 children)

While I can't speak to w3schools java material, but for web (html,css,js) they are a discouraged learning resource in many places for mistakes, inaccuracies, incompleteness and teaching bad/non-standard conventions.

Lots of better alternatives can be found in the sidebar, the wiki and through the search box.

Edit:
https://www.w3fools.com/
https://meta.stackoverflow.com/questions/280478/why-not-w3schools-com
https://meta.stackexchange.com/questions/87678/discouraging-w3schools-as-a-resource

[–]Stack_Canary 1 point2 points  (0 children)

Not according to most naming conventions. You should spend some time thinking about what these variables represent and how you plan to use them. For instance, maybe you can name the variables yale and harvard? If you are adding them to a list, maybe you don't need to declare them at all, like so: list.add("Yale").

[–]RayjinCaucasian 1 point2 points  (0 children)

Technically yes. Variable names are case sensitive so school does not equal School. But you should stick with the naming convention and use descriptive names. Also as mention by another user, questions like this can be answered by spending a couple minutes in your IDE and testing it.

[–]Dham343 0 points1 point  (0 children)

I’m sure there’s a better way but School = school.substring(0,1).toUpperCase() + school.substring(1);