Skip to content

Commit 2a48437

Browse files
committed
Added Comments exercise to practice comments (Java Beginners, Chapter 1)
1 parent 03c3ff7 commit 2a48437

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.codefortomorrow.beginner.chapter1.practice;
2+
3+
/**
4+
* @author ArmeetJatyani
5+
* March 2021
6+
*
7+
* You'll be writing your first ever comment today!
8+
* What we'll go over:
9+
* - single line comments
10+
* - multi line comments
11+
*/
12+
13+
// a class is an "object" where we will place all our code inside
14+
public class Comments {
15+
// the main method (below) is the first thing that runs when your program is run
16+
public static void main(String[] args) {
17+
// this is a single line comment, I can write anything here
18+
// single line comments aren't run by Java!
19+
// they can be used to annotate your code!
20+
21+
/**
22+
* this is a multi
23+
* line
24+
* comment
25+
*
26+
* It can span across multiple lines!
27+
*/
28+
29+
// YOUR ASSIGNMENT: write 1 single-line comment and 1 multi-line comment on the lines below...
30+
31+
32+
33+
34+
35+
36+
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.codefortomorrow.beginner.chapter1.practice;
2+
3+
/**
4+
* @author ArmeetJatyani
5+
* March 2021
6+
*
7+
* You'll be writing your first ever comment today!
8+
* What we'll go over:
9+
* - single line comments
10+
* - multi line comments
11+
*/
12+
13+
// a class is an "object" where we will place all our code inside
14+
public class Comments {
15+
// the main method (below) is the first thing that runs when your program is run
16+
public static void main(String[] args) {
17+
// this is a single line comment, I can write anything here
18+
// single line comments aren't run by Java!
19+
// they can be used to annotate your code!
20+
21+
/**
22+
* this is a multi
23+
* line
24+
* comment
25+
*
26+
* It can span across multiple lines!
27+
*/
28+
29+
// YOUR ASSIGNMENT: write 1 single-line comment and 1 multi-line comment on the lines below...
30+
31+
// Hi my name is Armeet!
32+
33+
/**
34+
* I like teaching Java, and
35+
* good luck on your journey!
36+
*/
37+
}
38+
}

0 commit comments

Comments
 (0)