DANCEST 805 Lecture Notes - Lecture 9: Newline, Infinite Loop, Dead Code

8 views8 pages
School
Department
Professor

Document Summary

You can define more than one method in a class. public class newline { Method names should begin with a lowercase letter and use camel case, which means that the second word starts with a capital letter (e. g. jammingwordstogehter). In the method above, both methods have two similarities: they are both public. It means that they can be invoked from other classes: they are both void. It means that they don"t yield a result. The parentheses after the method name contains a list of variables, which are called parameters. Parameter: a piece of information that a method requires before it can run. Parameters are variables: they contain values and have types. Since newline has no parameters, it requires no arguments, as is shown when invoked in main. And you can write a new method that invokes a previous method. Example: public static void threeline() { newline(); newline(); newline(); 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