CS 151 Lecture Notes - Lecture 4: Concatenation, String Literal
76 views2 pages
30 Jan 2017
School
Department
Course
Professor
Document Summary
Represented in java using the string class and string literals such as hello String literal can contain any valid characters. Println method is service performed by system. out. Parameter: each piece of data sent to method, this method has only one: to print string of characters. The print and println methods represent two services provided by the system. out object. The println method prints the information sent to it, then moves to the beginning of the next line. The print method is similar to println, but does not advance to the next line when completed. String literal cannot span multiple lines in a program. We can rely on string concatenation to append one string to the end of another using the operator + . Digits are characters and can be included in strings as needed. + operator is also for addition, the operation depends on the type of data.
Get access
Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers