DOC PREVIEW
UB CSE 115 - CSE 115 Syllabus

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE 115AnnouncementsLesson PlanClass DefinitionsClass NamesClass BodyAnswer: In file Date.javaSlide 8Constructor DefinitionSlide 10September 19, 2008AnnouncementsLesson PlanClass definitions (syntax)Class DefinitionsClass Headerpublic class identifierpublic (keyword) access control modifier stating that everything within the program has accessclass (keyword) states that we are about to define a classidentifier (name) Name of the class we are definingClass BodyClass Names Style – First letter of a class name is upper case followed by lower case letters until the end of the first word, subsequent words have their first letter in upper case. (camel case)Eg) MyFirstClassNameThe name of the class tells us the name of the fileClass BodySurrounded by { }Inside the {} are the definitions of the class’ properties followed by the definitions of the class’ capabilities.Exercise: Write the code for a class named Date that is in a package named calendar.Answer: In file Date.javapackage calendar;public class Date {}new Date();We are also calling a special capability of the object called a constructor. A constructor sets up the initial state of the object.State: The set of all the properties of an object and their values at a given time.Constructor DefinitionConstructor Headerpublic identifier()public – means same as beforeidentifier – same as the name of the classConstructor BodySurrounded by { }Answer: In file Date.javapackage calendar;public class Date { public Date() {


View Full Document

UB CSE 115 - CSE 115 Syllabus

Download CSE 115 Syllabus
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CSE 115 Syllabus and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CSE 115 Syllabus 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?