|
|
| Java |
Expert:Dedeepya
Hi
How to write java code inorder to get the comments written in a java program?
Please let me know..this was asked in my interview
Thanks in Advance |
| Answers |
Hi friend,
Please specify the problem in details.
For more information on Java visit to :
http://www.roseindia.net/java/
Thanks
|
Hi friend
Well there r 3 types of comments are allowed in java
1. /*.........*/ 2 // 3. /**.........*/
if u want to get comments then u hav to design a programme such that it must parse the programme for these comment symbols . anyhow the implementing code is left to u that goes on ur logic
for ex there must be 3 if conditions while parsing the java code u must follow these steps.. if(ch=='/') { here u increment ur char variable ,then if( ch=='*') { if(ch=="*') read characters until u encounter '*/' else read characters until u encounter '*/' } else if(ch=='/') read one line completely } else start parsing again
**Thanks..
|
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|