Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I use 1 boolean statement for 2 variables ?

 
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
Saloon Keeper
Posts: 15484
43
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic