Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit 2 Test: Tues 11/3. ASCII / Unicode –Each letter, symbol, etc has a # value –See ascii table (in folder) –To convert a char into its ascii value,

Similar presentations


Presentation on theme: "Unit 2 Test: Tues 11/3. ASCII / Unicode –Each letter, symbol, etc has a # value –See ascii table (in folder) –To convert a char into its ascii value,"— Presentation transcript:

1 Unit 2 Test: Tues 11/3

2 ASCII / Unicode –Each letter, symbol, etc has a # value –See ascii table (in folder) –To convert a char into its ascii value, type cast it into an integer, or save it in an integer variable. (The reverse can be done to convert an integer into its equivalent character.) –Demo: ascii

3 Method Overloading A method’s signature is its name and list of parameters. Method Overloading is when you use two methods with the same name, but different lists of parameters This is legal, as long as the parameters are different, in 1 of 3 possible ways: 1.Type 2.Number 3.Order

4 Why overload a method? Because sometimes you need to perform similar operations on different types of data –Demo: OverloadClass, OverloadClient A method’s return type is not part of its signature, so if 2 methods are only different in their return types, then Java won’t know the difference. This will cause an error.

5 Assignments P. 242 # 13-18 (#13: “floating point” is another name for a double) (#18: hint: the if-statement should NOT be very long)


Download ppt "Unit 2 Test: Tues 11/3. ASCII / Unicode –Each letter, symbol, etc has a # value –See ascii table (in folder) –To convert a char into its ascii value,"

Similar presentations


Ads by Google