CodeGym /Courses /Java Syntax /Introducing Kim

Introducing Kim

Java Syntax
Level 0 , Lesson 6
Available

A lecture snippet with a mentor as part of the Codegym University course. Sign up for the full course.


"Wow, another human woman! But with black hair this time. How exciting!"

"Hi, my name is Kim."

"Hi, my name is Amigo!"

"I know. I came up with your name. Diego wouldn’t have thought that up."

"Let's get back to the lesson. I'll use simple words to explain the material to you."

"OK."

"I'd like to add a few words to what the Professor and Rishi said."

"In Java, you can write commands, but you can also add comments to those commands right in the code. The compiler completely ignores the comments. When the program is run, all the comments are omitted."

"Give me an example, please."

"Oh, sure:"

public class Home
{
    public static void main(String[] args)
    {
        /*
        Now we'll display the phrase 'Amigo Is The Best' on the screen
        */
        System.out.print("Amigo ");
        System.out.print("Is ");
        System.out.print("The ");
        System.out.print("Best");
    }
}    

"We added the comment 'Now we'll display the phrase…' The beginning of the comment is indicated by a pair of symbols (/*), and the end – by (*/). When the program is compiled, the compiler omits everything between the symbols /* and */."

"Does that mean that I can write anything I want?"

"Yes. Usually, comments in code are about parts of the code that are difficult to understand. Some comments consist of dozens of strings, often written before methods to describe nuances in how those methods work."

"There is one more way to add a comment to code. You can use two forward slashes (//)."

public class Home
{
    public static void main(String[] args)
    {
        System.out.print("Amigo ");
        System.out.print("Is The "); // This is also a comment
        System.out.print("Best");
    }
}

"Here, the code starting with the // and up to the end of the line with the // is considered to be a comment. In other words, there is no second pair of symbols used to 'complete the comment'."

"By the way, some comments are really interesting."

// I'm not responsible of this code. They made me write it, against my will.
// Dear future me. Please forgive me.
// I can't even begin to express how sorry I am.
// If I see something like this once more, I'll have a complete mental breakdown at work.
// If this condition is ever satisfied,
// please inform me for a reward. Phone: xxx-xxx-xxx.
// Dear maintainer:
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
// total_hours_wasted_here = 42
// When I wrote this, only God and I understood what I was doing
// Now, God only knows
// Sometimes I believe compiler ignores all my comments.
// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.
// Drunk, fix later
// Magic. Do not touch

"Yes, some comments are very funny."

"That's all for today."

"That was a short but interesting lesson. Thanks, Kim."

Comments (166)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Abubakar Salisu Sodangi Level 2, Lagos, Nigeria
9 November 2025
omo i don't think it would be si tough
Anonymous #11686407 Level 1, Toronto, Canada
29 August 2025
public class Main { public static void main(String[] args) { System.out.println("Hello World"); } }
Anonymous #11684176 Level 2, -, India
20 August 2025
// java is Interesting
Anonymous #11677057 Level 2, Tiruchchirappalli, India
6 August 2025
public class Main{ public static void main (String[] args) { /*Jdhdbckfjndnd hi hello*/ System.out.print("Happy New year"); }}
Koosty Level 1, Indonesia
9 July 2025
/** * Wait until you see this. */
RubyBrownie Level 2, Victoria, Canada
23 June 2025
These are more about math than coding 😅
Anonymous #11665939 Level 2, Bangalore, India
26 August 2025
afterall the world revolves around maths lol😆
Abubakar Salisu Sodangi Level 2, Lagos, Nigeria
9 November 2025
ah swear
Anonymous #11650732 Level 1, Delhi, India
6 May 2025
Nice one
atul sharma Level 2, CodeGym University in India, India
1 May 2025
they dont know me son
LaikaLaikaka Level 32, United States of America, United States
15 March 2025
for the second task, i uncomment some lines, and i changed nothing else, but I failed with "You need to uncomment some lines. Don't change anything else."
Shubh Level 2, CodeGym University in India, India
3 March 2025
well this section was interesting lol
Anonymous #11677106 Level 2, Franklin, United States
30 July 2025
like the profile pic