Understanding Integer Class Methods [Integer.MIN_VALUE(),Integer.MAX_VALUE(),compareTo(),equals()] in Java using Eclipse IDE
Understanding Integer Class Methods [Integer.MIN_VALUE(),Integer.MAX_VALUE(),compareTo(),equals()] in Java using Eclipse IDE
In this tutorial, you will learn the following:
- Integer Class Methods
- Integer.MIN_VALUE()
- Integer.MAX_VALUE()
- compareTo()
- equals()
You would need the following inorder to following this tutorial:
- An Integrated Development Environment(IDE) installed that can run Java (e.g Netbeans, Eclipse)
- JDK 1.X installed on your Pc
- Of course willingness to learn
Difficulty
- Intermediate
Description
In this tutorial,firstly, the maximum and mimum value that an Integer can take was shown using the Integer.MAX_VALUE() and Integer.MIN_VALUE() methods respectively and also the compareTo() method was used to compare two Integer values together.
The equals() method is used to indicate if two Integers are of the same value.
The compareTo() method returns the following:
- 1: For when the Integer a is being compared with Integer b and a is greater.
- 0: For when the Integer a is being compared with Integer b and they are the same.
- -1: For when the Integer a is being compared with Integer b and b is greater.
Video Tutorial Link:
Curriculum
Below are a list of related videos that will make you understand this better!
NB: This video has only being shared on my Youtube Channel
Tutorial codes can be gotten from this github repository: https://github.com/generalkolo/Javacodes
Posted on Utopian.io - Rewarding Open Source Contributors
@edetebenezer, Contribution to open source project, I like you and upvote.
Thanks, @steemitstats
@OriginalWorks
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @edetebenezer I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x