views:

555

answers:

2

Specially in comparison to C/C++ (which are declarative), how is Java imperative?

+8  A: 

C/C++ is imperative too.

Edit: Imperative is do this, then do that, then do the next thing and so on. Declarative is, this are the rules, now what's the answer to this question. Google, you'll find plenty of info.

Mike Q
http://stackoverflow.com/questions/1619834/difference-between-declarative-and-procedural-programming has lots of examples of declarative vs. imperative languages which might help hanifr get a handle on what a declarative language is.
itowlson
+5  A: 

You are confusing the concepts, C and C++ are not declarative languages. Refer to Declarative Programming and Imperative Programming. Basically, with declarative languages (e.g. Prolog), you specifiy what you want to accomplish, without specifying how to accomplish it, which contrasts with imperative languages.

JG