OOP Lab Task 2: Diferență între versiuni
De la WikiLabs
Jump to navigationJump to search
(Pagină nouă: == Required Tutorials == * The Object Oriented Paradigm; Classes and Objects * Notions About the Java Language * Writing and Executing a Java Program * [[Java Syntax; A P...) |
|||
Linia 11: | Linia 11: | ||
== Requirements == | == Requirements == | ||
* | * Write a class called '''PrivateMessage''' which will be used as a data carrier between a chat client and a specific recipient. This class needs to: | ||
** Store the name of the sender, a message content and the name of the recipient; | |||
** the | ** Be immutable | ||
** | ** Allow reading of the sender and content information from the Message objects in a way specific to private messages in chat programs: "(priv) sender: contents". This must be done with only one method call. | ||
* | ** Have a way to read the message recipient from objects of type '''PrivateMessage'''. | ||
* | |||
* In the existing class '''Main''', instantiate at least 3 objects of type '''PrivateMessage''', and print for each one the formatted string and the recipient. | |||
* | |||
* | Notes: | ||
* | * Each class and class member must have one of the three access modifiers ''public'', ''private'' or ''protected''. | ||
* The names of the classes must be identical to the ones specified above. | |||
* Use inheritance and overriding. | |||
Submitting: | |||
* The assignment is submitted attaching the Java source code files exclusively to an e-mail sent to radu.hobincu@upb.ro. | |||
* The subject of the e-mail will be [POO_2] | |||
* The body of the e-mail will contain the name and group of the student and any additional command you want to make. | |||
* <font color="red">'''Attention'''</font> Any deviation from these instructions may lead to the loss of the entire amount of points. |
Versiunea de la data 23 noiembrie 2014 20:16
Required Tutorials
- The Object Oriented Paradigm; Classes and Objects
- Notions About the Java Language
- Writing and Executing a Java Program
- Java Syntax; A Program's Lexical Structure
- Coding Conventions
- Advanced Notions About Object Oriented Programming
- Java Application Programming Interface (API) (EN)
Requirements
- Write a class called PrivateMessage which will be used as a data carrier between a chat client and a specific recipient. This class needs to:
- Store the name of the sender, a message content and the name of the recipient;
- Be immutable
- Allow reading of the sender and content information from the Message objects in a way specific to private messages in chat programs: "(priv) sender: contents". This must be done with only one method call.
- Have a way to read the message recipient from objects of type PrivateMessage.
- In the existing class Main, instantiate at least 3 objects of type PrivateMessage, and print for each one the formatted string and the recipient.
Notes:
- Each class and class member must have one of the three access modifiers public, private or protected.
- The names of the classes must be identical to the ones specified above.
- Use inheritance and overriding.
Submitting:
- The assignment is submitted attaching the Java source code files exclusively to an e-mail sent to radu.hobincu@upb.ro.
- The subject of the e-mail will be [POO_2]
- The body of the e-mail will contain the name and group of the student and any additional command you want to make.
- Attention Any deviation from these instructions may lead to the loss of the entire amount of points.