Содержание
- 2. Class – why? Classes split application code to parts (from sophisticated to simple) Very often class
- 3. Class Description class name { // field declarations // method declarations } * Infopulse Training Center
- 4. Class Fields Class fields should be declared inside class out of all class methods Fields can
- 5. Defining Methods return_type method_name (parameter_list){ // method body } Example: int getFinalData(int a, int r){ int
- 6. Return Type The return type describes the value that comes back from the method A method
- 7. Parameters Any data type is possible for a parameter of a method Construct varargs is used
- 8. Constructors Constructor name should be the same as class name Constructor has no return type The
- 9. Objects Creating Object: class_name object_variable = new construtor_call; Declaring a Variable to Refer to an Object:
- 10. Using the this Keyword this is a reference to the current object The most common example:
- 11. Complex Numbers (1 of 4) Is it always possible to solve square equation within real numbers
- 12. Complex Numbers (2 of 4) Is it always possible to solve square equation within real numbers
- 13. Complex Numbers (3 of 4) Number of a + b * i type where a and
- 14. Complex Numbers (4 of 4) To add complex numbers use formula To multiply complex numbers use
- 15. Exercise 2.4.1. Create a class for saving and manipulating complex numbers. * Infopulse Training Center
- 16. Home Exercise 2.4.2 (1 of 2) 3D Vector is ordered sequence of 3 numbers (vector’s coordinates):
- 18. Скачать презентацию