Jan. 24th, 2018

jbanana: Badly drawn banana (Default)
Using only your brain, can you figure out what this will print?
public class Plus5{
   public static void main(String[] args){
      int i = 1;
      System.out.println( i++ + ++i );
 
      i = 1;
      System.out.println( i-- - --i );
   }
}
The code is Java, but I think you'd get the same results from i++ + ++i and i-- - --i in other languages that have those operators.

May 2025

M T W T F S S
   1234
5678 91011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 29th, 2025 04:29 pm
Powered by Dreamwidth Studios