Write a class with a main method that contains members of type:
- int
- byte
- short
- long
- float
- double
- boolean
- char
- int[]
This class should have methods:
- getMyInt()
- getMyByte()
- etc.
- getMyIntArray()
- etc. // for a total of 9 of these 'getter methods'.
And each of those methods should print out the value you assigned to the member variable.For getMyIntArray() you will need a loop to loop over the array and print each int.
The class should also 4 more methods:
- useAnIfElseStatement() // contains an if{}else{} statement
- useAWhileLoop() // contains a while loop
- useAndComparator() // uses &&
- useOrComparator() // uses ||
This little assignment is to get your feet wet with basic Java syntax. There's no programming challenge here other than to use the language features we discussed in class.
See the attached sample code as an example.
Due by midnight on Sunday, September 8th 2019. ( The midnight between Sunday and Monday ) Submit a unique assignment. You are free and encouraged to work together while studying this very interesting subject, but two identical assignmnets will get a zero for each one! Make variable names and values, class names, function names different to ensure everyone has a unique submission.
People who missed the first class due to waitlist, etc. will have to submit this by Sunday, September 15th along with the week02 assignment.