You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lesson_04/evanphilakhong/README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,4 +50,15 @@ public static boolean isPrime(int num) {
50
50
51
51
## Explanation
52
52
53
-
The C++ implementation is using a function named `isPrime` that takes a single parameter `num` representing the number the function is checking if it's a prime number or not. The function returns `True` if the number is **Prime**
53
+
The **C++** implementation is using a function named `isPrime` that takes a single parameter `num` representing the number the function is checking if it's a prime number or not. The function returns `True` if the number is **Prime**, otherwise it returns `False`.
54
+
55
+
The **Java** implementation is using a function named `isPrime` that takes a single parameter `num` representing the numer the function is checking if it's a prime number or not. The function returns `True` if the number is **Prime**, otherwise it returns `False`.
56
+
57
+
### Differences
58
+
59
+
1.**File Stucture**:
60
+
- In **C++**, you have the ability to create a header file to store libraries and function declorations. While Java has no such thing.
61
+
-**Java** forces you to work in a `Class` while, **C++** lets you work outside of `Classes`
62
+
63
+
2.**Syntax**:
64
+
- The syntax for printing to the console/output is a little different. **C++** uses `cout` while, **Java** uses `System.out.print();`
0 commit comments