Review Of Variables, Arguments, and Returns
From Huben's Wiki
Have written answers to each of these questions. Demonstrate that you can, with an example, rather than saying "yes I can".
- Name (if I give you an example) and explain all the bold terms in all the lessons?
- Spot the difference between a variable definition and a method signature?
- Name the 4 most important basic types for variables?
- Say what other type we use frequently?
- If that other type is not a basic type, what is it?
- Say what kind of capitalization we use for variables?
- Say what the number 5 is when we initialize an integer, or what "honk" is when we initialize a String?
- Say what the possible values of a boolean are?
- Identify the three kinds of variables in a program: fields, arguments, and local? Where are they?
- Say which kinds of variables are limited to a single method?
- Say what the word is for this limitation?
- Tell me what Math is when I say Math.sin(0) ?
- Tell me the result of '20 % 7' ?
- Tell me if Java uses PEMDAS?
- Spot an array type? What does it have?
- Create an array variable and initialize it to several values?
- Tell me the index (number) of the very first element in an array?
- Print a value out of an array if I tell you the index?
- Tell me which class you must run if you are working with more than one class?
- Say what the reserved word 'return' does?
- Identify other reserved words that we have covered?
- Explain the scopes of fields, arguments, and local variables?
- Write literals for int, double, and String?
- Tell me the two parts of a variable declaration?
- Identify in a method declaration the:
- return type
- argument types and names
- Explain the problem: if I have a method public static int a(int b) why can't I call it with a(6.3)?
- Write a simple method that has a double array for an argument. The method should return the product of the first two elements of the array. Remember to include the return type!
- Create an array of doubles in a main with at least two elements that you pick at random.
- Call your simple method in main with your array, and print the result.
- Remember all the things from the previous Review Of Demonology Beginnings?