COSC 111 Lecture Notes - Lecture 20: Type Signature

83 views6 pages
Verified Note

Document Summary

= lectures 9 (october 2nd , 2018) - 16 (october 25th, 2018) = chapters 5: loops 7: single-dimensional arrays. While loop (w/ break) int sum = 0; int number = 0; while (number < 20) { number++; sum += number; if (sum >= 100) break; For-loop (w/ continue) for (int i=2; i < 10; i++){ if (i % 2 == 0) For-each loop double [] array = {1. 2, 3. 4, 5. 6}; for (double x: array) System. out. println(methodname(1,2)); methodname(hi); public static int methodname(int a, int b) { int result = a + b; return result; public static void methodname(string s) { Primitive data = just holds a value of its declared type: ex. byte, char, short, int, long, float, double, boolean. Reference data = holds a pointer to where an object is stored in the memory: ex. strings, arrays, scanners, etc. = part of the program where the variable can be referenced.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents