• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I use 1 boolean statement for 2 variables ?  RSS feed

 
WeiJie Lim
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to code a boolean statement to check if the year stored in the following variables is a leap year or not. I remembered being able to use only 1 boolean statement for this, but I forgotten how I did it =/

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want to repeat the whole statement each time, you can ofcourse write a method that contains the statement, and call the method instead of repeating the whole statement.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!