COMPSCI 2S03 Lecture Notes - Lecture 4: Multiple Choice, Short Circuit

59 views3 pages

Document Summary

Second part is to write a program in java. Printf is the method (dot operator of class, for methods) import java. util. Package names in java: java. util < package name java. lang < another package. Methods in scanner class nextdouble(), nextline(), nextint(), next(), nextshort() etc. Enter a number: 23(line feed, return key to separate inputs) Enter two number: 23(line feed, return)15(return) < two values assigned to nextint() for example. Enter name: haya(return) < the buffer stores haya. Java will take the enter as the nextline and won"t read the name, so we use nextline to get rid of line return. Another class: buffer, can create an object to read char by char. You can change the code for any number of digits (not just three) by running a loop until you get mod 0. The number of times these statements will be executed is always the same java. lang has some primitive data types.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions