SlideShare a Scribd company logo
1 of 5
PRG 420 Week 5 Team Paper
Link : http://uopexam.com/product/prg-420-week-5-team-paper/
Sample content
This team paper explains the following concepts with examples:
1. Class
2. Objects (instances)
3. Instance Variables (attributes or properties)
4. Interfaces
5. Encapsulation
6. Inheritance
7. Polymorphism.
Class:
A class indicates a category of items, as well as acts as a model for producing this
kind of items. A class models an abstraction by defining the characteristics as well
as behaviors for the items symbolizing the abstraction. The characteristics of an
item of a class are also known as features, as well as are described by fields in
Java. A field in a class definition is a variable that can store a value which
represents a specific property. The behaviors of an item of a class are also called
operations, as well as are described using methods in Java. Fields as well as
methods in a class definition are jointly called members. For instance we are
thinking about a class CharStack to show the different ideas of object-oriented
programming.
// Source Filename: CharStack.java
public class CharStack { // Class name
// Class Declarations:
// (1) Fields:
private char[] stackArray; // The array implementing the stack.
private int topOfStack; // The top of the stack.
// (2) Constructor:
public CharStack(int n) { stackArray = new char[n]; topOfStack = -1; }
// (3) Methods:
public void push(char element) { stackArray[++topOfStack] = element; }
public char pop() { return stackArray[topOfStack--]; }
public char peek() { return stackArray[topOfStack]; }
public boolean isEmpty() { return topOfStack
public boolean isFull() { return topOfStack == stackArray.length – 1; }
}
A class description includes a group of member declarations. In the case of the
class CharStack, it has two fields:
• stackArray, that is an array to hold the elements of the stack (in this instance
characters)
• topOfStack, that denotes the top element of the stack (i.e., index of the last
character stored in the array)
The class CharStack has five techniques which execute the essential operations
on a stack:
• push() pushes a character on to the stack
• pop() takes away as well as returns the top element of the stack
• peek() returns the top element of the stack for examination
• isEmpty() decides if the stack is vacant
• isFull() decides if the stack is complete
The class description also has a method-like declaration with the same name as
the class, (2). These kinds of declarations are known as constructors. As we shall
observe, a constructor is carried out when an item is created from the class. But,
the execution details in the instance aren’t essential for the current
discussion.
Objects (instances):
An item is an example of a class. The item is developed using the class as a
model as well as is a solid example of the abstraction that the class shows. An item
should be created prior to it being used in a program. In Java, items are
manipulated through object references (also known as reference values or simply
references). The process of developing items normally involves the following steps:
1. Declaration of a variable to store the object reference.
This involves declaring a reference variable of the suitable class to store the
reference to the item.
// Declaration of two reference variables that will denote
// two distinct objects, namely two stacks of characters, respectively.
CharStack stack1, stack2;
2. Creating an object.
This requires using the new operator along with a call to a constructor, to develop
an example of the class.
// Create two distinct stacks of chars.
stack1 = new CharStack(10); // Stack length: 10 chars
stack2 = new CharStack(5); // Stack length: 5 chars
The new operator returns a reference to a new instance of the CharStack class.
This reference can be allotted to a reference variable of the suitable class.
Each item has a exclusive identity and has its own copy of the fields stated in the
class description. The two stacks, denoted by stack1 and stack2, will have their
own stackArray and topOfStack fields.
The aim of the constructor
http://uopexam.com/product/prg-420-week-5-team-paper/

More Related Content

More from seeddarcy

More from seeddarcy (8)

ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Recently uploaded (20)

Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 

PRG 420 Week 5 Team Paper 2015 version

  • 1. PRG 420 Week 5 Team Paper Link : http://uopexam.com/product/prg-420-week-5-team-paper/ Sample content This team paper explains the following concepts with examples: 1. Class 2. Objects (instances)
  • 2. 3. Instance Variables (attributes or properties) 4. Interfaces 5. Encapsulation 6. Inheritance 7. Polymorphism. Class: A class indicates a category of items, as well as acts as a model for producing this kind of items. A class models an abstraction by defining the characteristics as well as behaviors for the items symbolizing the abstraction. The characteristics of an item of a class are also known as features, as well as are described by fields in Java. A field in a class definition is a variable that can store a value which represents a specific property. The behaviors of an item of a class are also called operations, as well as are described using methods in Java. Fields as well as methods in a class definition are jointly called members. For instance we are thinking about a class CharStack to show the different ideas of object-oriented programming. // Source Filename: CharStack.java public class CharStack { // Class name // Class Declarations: // (1) Fields: private char[] stackArray; // The array implementing the stack. private int topOfStack; // The top of the stack. // (2) Constructor: public CharStack(int n) { stackArray = new char[n]; topOfStack = -1; }
  • 3. // (3) Methods: public void push(char element) { stackArray[++topOfStack] = element; } public char pop() { return stackArray[topOfStack--]; } public char peek() { return stackArray[topOfStack]; } public boolean isEmpty() { return topOfStack public boolean isFull() { return topOfStack == stackArray.length – 1; } } A class description includes a group of member declarations. In the case of the class CharStack, it has two fields: • stackArray, that is an array to hold the elements of the stack (in this instance characters) • topOfStack, that denotes the top element of the stack (i.e., index of the last character stored in the array) The class CharStack has five techniques which execute the essential operations on a stack: • push() pushes a character on to the stack • pop() takes away as well as returns the top element of the stack • peek() returns the top element of the stack for examination • isEmpty() decides if the stack is vacant • isFull() decides if the stack is complete The class description also has a method-like declaration with the same name as the class, (2). These kinds of declarations are known as constructors. As we shall
  • 4. observe, a constructor is carried out when an item is created from the class. But, the execution details in the instance aren’t essential for the current discussion. Objects (instances): An item is an example of a class. The item is developed using the class as a model as well as is a solid example of the abstraction that the class shows. An item should be created prior to it being used in a program. In Java, items are manipulated through object references (also known as reference values or simply references). The process of developing items normally involves the following steps: 1. Declaration of a variable to store the object reference. This involves declaring a reference variable of the suitable class to store the reference to the item. // Declaration of two reference variables that will denote // two distinct objects, namely two stacks of characters, respectively. CharStack stack1, stack2; 2. Creating an object. This requires using the new operator along with a call to a constructor, to develop an example of the class. // Create two distinct stacks of chars. stack1 = new CharStack(10); // Stack length: 10 chars stack2 = new CharStack(5); // Stack length: 5 chars The new operator returns a reference to a new instance of the CharStack class. This reference can be allotted to a reference variable of the suitable class. Each item has a exclusive identity and has its own copy of the fields stated in the class description. The two stacks, denoted by stack1 and stack2, will have their own stackArray and topOfStack fields.
  • 5. The aim of the constructor http://uopexam.com/product/prg-420-week-5-team-paper/