CSC 2010 Lecture Notes - Lecture 25: Cmd.Exe, Rogue Trooper, Nipple

31 views8 pages
School
Course
Professor

Document Summary

Let us start with some code for a class: public class account. String name; double balance; public account(string n, double b) name = n; balance = b; The class we are building here will be a template for an account at a bank. constructor for the class, which has the same name account as the class is. There are two class variables, name and balance. The public account(string n, double b) name = n; balance = b; It has a parameter list account(string n, double b) in the creation of an instance of this class. which will be used. The code for the class is kept in a separate file account. java. The next program, bank. java, will eventually be a collection of accounts. The file bank. java is kept in the same directory as account: public class bank public static void main(string args[]) In this application we are constructing an account for ronald, with an initial deposit of .

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