update code#16
Open
chathuryaadapa wants to merge 1 commit into
Open
Conversation
Comment on lines
+16
to
+25
| Map<String, Integer> wordCount = new HashMap<>(); | ||
| for (String word : words) { | ||
| int count = 0; | ||
| for (String w : words) { | ||
| if (w.equals(word)) { | ||
| count++; | ||
| } | ||
| } | ||
| wordCount.put(word, count); | ||
| } |
Collaborator
There was a problem hiding this comment.
suggested comment:
Map<String, Integer> wordCount = new HashMap<>();
for (String word : words) {
int count = 0;
for (String w : words) {
if (word.equals(w)) {
count++;
}
}
wordCount.put(word, count);
}
from 16 to 25
Comment on lines
+27
to
+28
| System.out.println(wordCount); | ||
| } |
Collaborator
There was a problem hiding this comment.
suggested comment:
System.out.println(wordCount);
from 27 to 28
Comment on lines
+1
to
+4
| import java.io.BufferReader; | ||
| import java.io.BufferWriter; | ||
| import java.io.FileRead; | ||
| import java.io.FileWrite; |
Collaborator
There was a problem hiding this comment.
suggested comment:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
from 1 to 4
Comment on lines
+85
to
+89
| int a = 5; | ||
| int b = 2; | ||
| double result = a / b; | ||
| System.out.println(result); | ||
|
|
Collaborator
There was a problem hiding this comment.
suggested comment:
int a = 5;
int b = 2;
double result = (double) a / b;
System.out.println(result);
from 85 to 89
Comment on lines
+90
to
+93
| String name = "John"; | ||
| if (name == "John") { | ||
| System.out.println("Hello, John!"); | ||
| } |
Collaborator
There was a problem hiding this comment.
suggested comment:
String name = "John";
if (name.equals("John")) {
System.out.println("Hello, John!");
}
from 90 to 93
Comment on lines
+8
to
+12
| public static String reverseString(String str) { | ||
| String reversed = ""; | ||
| for (int i = str.length() - 1; i >= 0; i--) { | ||
| reversed += str.charAt(i); | ||
| } |
Collaborator
There was a problem hiding this comment.
suggested comment:
public static String reverseString(String str) {
StringBuilder reversed = new StringBuilder();
for (int i = str.length() - 1; i >= 0; i--) {
reversed.append(str.charAt(i));
}
return reversed.toString();
}
from 8 to 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.