Two forward slashes (//) begin single-line comments. The compiler ignores any content between // and the end of the line (will not be executed).
// is really a single-line comment. From the // through the end of the line, everything is a comment. Use /* to start a comment and */ to finish a comment to mark a whole region as a comment. * This is an example of a block comment.
Any sequence of characters after the //(two slashes) characters. This type of comment is terminated by a new line that is not immediately preceded by a backslash. As a result, it's known as a "single-line comment."
Single line comments in Ruby are used to document code and provide instructions or explanations.
Comments in Ruby are denoted with the '#' symbol.
Share With Friend
Have a friend to whom you would want to share this course?
Download LearnVern App
Code Scan
or
Download the app
598K+
Downloads
4.57
Avg. Ratings
15K+
Reviews
Learn anywhere on the go
Get regular updates about your enrolled or new courses
Share content with your friends
Evaluate your progress through practice tests
No internet connection needed
Enroll for the webinar and join at the time of the webinar from anywhere
Enjoying this course!
All the Courses on Learnvern are Free! So Register/Sign in to
have Access all the Courses and Videos.