File tree Expand file tree Collapse file tree 14 files changed +72
-96
lines changed Expand file tree Collapse file tree 14 files changed +72
-96
lines changed Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter14 .practice ;
22
3-
43/*
54The file “numbers.txt” has 100 random numbers
65(one on each line). Use file i/o to find the
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter14 .practice ;
22
3-
43/*
54Practice: Use File I/O to compare two files lexicographically.
65Lexicographical order is very similar to alphabetical order,
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter16 .solutions ;
22
3- import java .util .LinkedList ;
43import java .util .ArrayList ;
4+ import java .util .LinkedList ;
55
66/*
77Using the methods outlined in the “Benefits of LinkedLists” section,
Original file line number Diff line number Diff line change 11package com .codefortomorrow .advanced .chapter16 .solutions ;
22
3- import java .util .LinkedList ;
43import java .util .Arrays ;
4+ import java .util .LinkedList ;
55
66/*
77Write a method which takes in a LinkedList of Strings
Original file line number Diff line number Diff line change 33/**
44 * @author ArmeetJatyani
55 * March 2021
6- *
7- * You'll be writing your first ever comment today!
8- * What we'll go over:
6+ *
7+ * You'll be writing your first ever comment today!
8+ * What we'll go over:
99 * - single line comments
1010 * - multi line comments
1111 */
1212
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
13+ // a class is an "object" where we will place all our code inside
14+ public class Comments {
15+
16+ // the main method (below) is the first thing that runs when your program is run
1617 public static void main (String [] args ) {
1718 // this is a single line comment, I can write anything here
1819 // single line comments aren't run by Java!
@@ -22,17 +23,11 @@ public static void main(String[] args) {
2223 * this is a multi
2324 * line
2425 * comment
25- *
26+ *
2627 * It can span across multiple lines!
2728 */
2829
2930 // YOUR ASSIGNMENT: write 1 single-line comment and 1 multi-line comment on the lines below...
3031
31-
32-
33-
34-
35-
36-
3732 }
38- }
33+ }
Original file line number Diff line number Diff line change 33/**
44 * @author ArmeetJatyani
55 * March 2021
6- *
7- * Welcome to Java!
6+ *
7+ * Welcome to Java!
88 * This may be your first ever java program!
99 * We'll begin your journey with the infamous Hello World program!
1010 */
1111
12- // a class is an "object" where we will place all our code inside
13- public class HelloWorld {
12+ // a class is an "object" where we will place all our code inside
13+ public class HelloWorld {
14+
1415 // the main method (below) is the first thing that runs when your program is run
1516 public static void main (String [] args ) {
1617 // write code here (replace the "" with "Hello World!")
1718 System .out .println ("" );
1819 }
19- }
20+ }
Original file line number Diff line number Diff line change 33/**
44 * @author ArmeetJatyani
55 * March 2021
6- *
7- * You'll be writing your first ever comment today!
8- * What we'll go over:
6+ *
7+ * You'll be writing your first ever comment today!
8+ * What we'll go over:
99 * - single line comments
1010 * - multi line comments
1111 */
1212
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
13+ // a class is an "object" where we will place all our code inside
14+ public class Comments {
15+
16+ // the main method (below) is the first thing that runs when your program is run
1617 public static void main (String [] args ) {
1718 // this is a single line comment, I can write anything here
1819 // single line comments aren't run by Java!
@@ -22,7 +23,7 @@ public static void main(String[] args) {
2223 * this is a multi
2324 * line
2425 * comment
25- *
26+ *
2627 * It can span across multiple lines!
2728 */
2829
@@ -31,8 +32,8 @@ public static void main(String[] args) {
3132 // Hi my name is Armeet!
3233
3334 /**
34- * I like teaching Java, and
35+ * I like teaching Java, and
3536 * good luck on your journey!
3637 */
3738 }
38- }
39+ }
Original file line number Diff line number Diff line change 33/**
44 * @author ArmeetJatyani
55 * March 2021
6- *
7- * Welcome to Java!
6+ *
7+ * Welcome to Java!
88 * This may be your first ever java program!
99 * We'll begin your journey with the infamous Hello World program!
1010 */
1111
12- // a class is an "object" where we will place all our code inside
13- public class HelloWorld {
12+ // a class is an "object" where we will place all our code inside
13+ public class HelloWorld {
14+
1415 // the main method (below) is the first thing that runs when your program is run
1516 public static void main (String [] args ) {
1617 // write code here (replace the "" with "Hello World!")
1718 System .out .println ("Hello World!" );
1819 }
19- }
20+ }
Original file line number Diff line number Diff line change 33/**
44 * @author ArmeetJatyani
55 * March 2021
6- *
6+ *
77 * Print out the number of apples and oranges!
88 */
99
10- public class ApplesOranges {
10+ public class ApplesOranges {
11+
1112 public static void main (String [] args ) {
1213 // write your code here
13-
14+
1415 // define an integer variable called numOranges with value 10 (line 15)
1516
16-
1717 // define an integer variable called numApples with value 24 (line 18)
1818
19-
2019 // print out number of oranges using variables, output: "I have 10 oranges." (line 21)
2120
22-
2321 // print out number of apples using variables, output: "I have 24 apples." (line 24)
2422
25-
2623 }
27- }
28-
24+ }
Original file line number Diff line number Diff line change 33/**
44 * @author ArmeetJatyani
55 * March 2021
6- *
6+ *
77 * Define different types of variables
88 */
99
10- public class VariableTypes {
10+ public class VariableTypes {
11+
1112 public static void main (String [] args ) {
1213 // write your code here
13-
14+
1415 // define an integer variable on line 15
1516
16-
1717 // define a float variable on line 18
1818
19-
2019 // define a double variable on line 21
2120
22-
2321 // define a boolean variable on line 24 (Hint: true/false)
2422
25-
2623 // define a character variable on line 27
2724
28-
29- // define a string variable on line 30
30-
25+ // define a string variable on line 30
3126
3227 }
33- }
34-
28+ }
You can’t perform that action at this time.
0 commit comments