
Just another developer's blog
OpenStreetMap is a website for collaborative mapping. I just signed up and spent about an hour editing the map nearby my apartment and workplaces. It was so much fun. Added a bunch of bus stops, library, grocery supermarkets and banks. Its good that we have an alternative to Google map and it belongs to no one and everyone.
http://www.openstreetmap.org>Download the ‘MUNI Live’ android app
https://play.google.com/store/apps/details?id=com.hellothupten.sf_muni
[Read more…]This code will compile and run. Notice the assignment operator(=) in the condition.
boolean a;
boolean b = true;
if(a=b){
//do anything;
//this compiles
}
But this won’t compile
int a;
int b = 5;
if(a=b){
//notice its still = not ==
//do anything;
//this does not compile
}
The reason is because the previous code’s a is of
booleantype and the latter’s is of
inttype.
ifstatement is not necessarily followed by a condition.
a=bis not a condition. Its an assignment. But it works if the left variable (i.e. a) is of a boolean type.
So its better if we think
if(boolean)instead of
if(condition). Anyway, a condition like
a==b or a>b etc will result a boolean result.
Copyright © 2025 · Latitude Theme on Genesis Framework · WordPress · Log in