CS 106A Lecture Notes - Lecture 10: Hard Disk Drive, Substring

21 views3 pages

Document Summary

Week 4, monday, april 18th, 2016 another outputs a character: using equals to compare two strings instead of == Announcements: yeah hours on wednesday for hw 3, which has already been posted. Type char (pronounced kar : char: a primitive type representing single characters, a string is stored internally as an array of char, it is legal to have variables, parameters, returns of type char. Surrounded with apostrophes; can only use one character with char. The charat method: the chars in a string can be accessed using the charat method. Can also use substring method, but one outputs a string and. Accepts an int index parameter and returns the char at that index. Can use a for loop to print or examine each character. Comparing char values: you can even loop over a range of character values ( < or >) Char and int: each char is mapped to an integer value internally.

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