-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create CheckPalindrome.java #84
Conversation
Created a Program to check whether a number is Palindrome or not
Reviewer's Guide by SourceryThis PR introduces a new Java program that checks whether a given integer is a palindrome. The implementation uses a straightforward approach of reversing the number and comparing it with the original, while also handling edge cases like negative numbers and numbers ending with zero. Class diagram for PalindromeCheck.javaclassDiagram
class PalindromeCheck {
+main(String[] args)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SayedZahur786 - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- The class name 'PalindromeCheck' doesn't match the file name 'CheckPalindrome.java', which will cause compilation errors in Java (link)
Overall Comments:
- The class name 'PalindromeCheck' doesn't match the file name 'CheckPalindrome.java'. Please ensure they match to avoid compilation issues.
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue, 1 other issue
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -0,0 +1,36 @@ | |||
import java.util.Scanner; | |||
|
|||
public class PalindromeCheck { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The class name 'PalindromeCheck' doesn't match the file name 'CheckPalindrome.java', which will cause compilation errors in Java
int reversed = 0; | ||
|
||
// Reverse the integer | ||
while (num > 0) { | ||
int lastDigit = num % 10; | ||
reversed = reversed * 10 + lastDigit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The integer reversal logic could cause overflow for large input numbers
Consider using long instead of int, and add overflow checking logic
Sir Please add HacktoberFest and Hacktober Fest Accepted Label in My PR |
Created a Program to check whether a number is Palindrome or not
Summary by Sourcery
New Features: