Question 7


#1

What is the correct way to write comment


#2

if you have a short comment to write then you use // followed by statements
eg

//this is  a single line comment if you want to comment on another line you 
//will have to start it with // too

but if you comment is an entire paragraph with line breaks then you begin with /* and end your paragraph with */
eg

/* this is a multi-line comment
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; 
Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. 
Nulla porttitor accumsan tincidunt. 
Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. 
Quisque velit nisi, pretium ut lacinia in, elementum id enim. 

*/

#3

// /*
hi */ System.out.println("Noise!");

how can i do this exercise?
1.The statement on line 4 prints out Noise!. Ask Java to ignore it by commenting it out. Place two forward slashes (//) at the beginning of line 4.
2.Write
a multi-line comment that begins anywhere after the single line comment
you just wrote. Again, the comment can say anything you like.

thanks


#4

@rydan has provided you with the neccecary skills to acomplish that. look over his notes in post #2.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.