您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Apply Index

Apply Page # 4

Activity 4 – Counting spaces in a string

Write a Java applet that counts the number of spaces in the string of text "the cat sat on the mat". It should do this by using a String variable and a loop.

The screen should looks as follows when run:

image14.gif (3360 bytes)

Discussion/Suggested solution to Activity 4

Back to content

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg