OOP Lab Task 1

De la WikiLabs
Versiunea din 22 octombrie 2013 12:19, autor: Rhobincu (discuție | contribuții) (Pagină nouă: == Required Tutorials == * Object Oriented Paradigm; Classes and Objects * Notions About the Java Language * Writing and Executing a Java Program * [[Java Syntax; A Progr...)
(dif) ← Versiunea anterioară | Versiunea curentă (dif) | Versiunea următoare → (dif)
Jump to navigationJump to search

Required Tutorials

Requirements

  • Write a class called Message which should abstract out a physical letter. Class Message should have fields for sender, receiver and content, of type string of characters.
  • Write a method called print(), member of class Message, which will output in the standard stream (console), the information related to Message objects, in the format: From <sender> to <receiver>: <content> (use System.out.println());
  • Write a class called TestClass which should only contain the main method as a member, in which you should instantiate 3 objects of type Message, initialize their fields with different values and call, for each object, the method print().