COMP 202 Lecture Notes - Lecture 3: Movember

15 views4 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

The variable type boolean can store either true or false. A char stores a single character from the unicode data set char size; size = s"; Modulo (remainder) % : it performs integer division and outputs the remainder. Try these: int half = 1/2; int one = half + half; System. out. println (one); int quotient = 32/3; int remainder = 32%3; In java the default floating point type is double. We can convert back and forth between double and int by using typecasting int x = 3; double y = 4. 56; int n = (int) y; double m = (double) x; //a program to practice how to convert from one type to another public class typeconversion { String s = 3; double x; int y; // copy the value from s to x x = double. parsedouble (s); //copy the value from x to y y = (int) x; public static void main (string [] args ) {

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

Related Questions