Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doing funny things with code, trying to copy code in TextArea leaving out comments

Philipp Geba
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exercise is using a given class TextFlaeche:
(Sorry that there are lots of comments in there but we need them later on anyway...)

Write a program using RandomAccessFile to copy the code of TextFlaeche into a String[] "content"...
Make a TextFlaeche-Object, create a TextArea and copy the code upside down into the text area...
(With numbered lines and append())

To have more fun: LEAVE OUT THE COMMENTS!!!
It works somewhat like 7/10.

Problem is that it doesn't leave out the lines that begin with "/*" and I don't get why!
I used boolean kommentarVanish to leave out lines...
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic