Wj 1102a Module2 Exercise 2

  • Uploaded by: Rajani Ramsagar
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Wj 1102a Module2 Exercise 2 as PDF for free.

More details

  • Words: 125
  • Pages: 1
Exercise 3: Using the String Class

The objective of this exercise is to create and initialize String objects and to print their contents.

Task 1 – Creating and Manipulating String Objects In this task, you write a class called PersonTwo that creates and initializes two String variables and displays their values. Follow these steps to create your class: 1. Go to the object_structure directory. 2. Create a class called PersonTwo that creates and initializes two variables: •

The first variable stores a quotation.



The second variable stores the name of the person who said it.

3. Use a method called displayQuote to display the quotation and the name to the screen. 4. Compile your class. 5. Execute your class using the supplied PersonTwoTest class.

Related Documents


More Documents from ""