150 likes | 227 Views
Dive deep into namespaces, classes, and object-oriented concepts. Explore scope, access modifiers, and inheritance. Learn to organize code efficiently with namespaces and static properties. Enhance your database skills and overcome common challenges.
E N D
Agenda • Finish Database Code from Last Class • Objects and Classes • An Overview • Creating Objects
Tuesdays Database Problem Explained Last class there was a problem with my database. If you have a basic install you shouldn’t have this problem. I have put the details on my site, please ask me about it after class if you have questions.
Finish Database Program • We will redo the example from class
Namespaces, Classes, and Objects • Namespaces are groups of STUFF • Objects are instances of a Class • Scope • private, public, protected • Classes can Inherit from other classes • Derived objects are called “children”
Scope • Scope tells us “who can access and change properties and methods” • Keywords • Private, Public, Protected • static
Namespaces • Namespaces are way to organize groups of stuff • You can put namespaces inside of namespaces • Used to organize our variables and methods • Using statements allow quick namespace access
Access Modifiers • Private • Only the object can access • Public • Everyone can access • Protected • Only children can access
Misc. Keywords • static • Lets a class access a method or property without an instance of an object • Methods, Classes, and Variables can be “Static”
Properties • Get/Set • private set • means we can only change this property inside the class
Constructors • When we create an object we use a line of code that looks like: MyObjmo = new MyObj(); • This creates an object with the default values. • We specify these in the constructor
Overloading • We can have multiple functions with the same name. • This works for constructors Point p = new Point(); Point q = new Point(3,4);
Some Class Examples • I will run through some examples in class and upload the code to my website
Course Announcement • Dinner tomorrow • Please Join us!
안녕하세요? 계산과학 연합전공입니다. 저희 전공 신입생 환영회 겸 개강파티를 갖고자 합니다. 전공학생이 아니어도 전공과목 수강생, 전공 관심있는 학생 누구든 환영이구요맛있는 삼겹살을 먹으며 함께 친목을 다지는 시간이 되었으면 좋겠습니다. 전공 주임교수인 이상묵 교수님 외 2013-2학기 개설 강의 교수님들께서도 참석하실 예정이니많은 참석 부탁드립니다. 일시 : 2013년 9월 27일 (금), 17:30 ~ 장소 : 풍년옥 (서울대입구역 3번 출구 도보 5분) 감사합니다. 계 산 과 학 연 합 전 공