please tell me in how many ways OBJECT ORIENTED PROGRAMMING is different from procedural programming in JAVA
OOP is just a way to break down your problem.
If your working procedurally, you'll break down your problem into smaller problems that are solved with procedures.
If your working with OOP, you'll try to first break down the program into objects, and define what you "do" with the objects via methods.
You'll generally work with a mix of the two.
thanks for help
Java is puerly object oriented or not?
Not 100%. "Primitive" types (int, boolean, char , float etc) are not objects.
well...nothing is purely oop or procedural. But some have more support for oop concepts and doing oop stuff. Java has many classes that supports oop porgramming methods which makes the programmer's life eay. So many say it is an oop language. You can write programs in procedural way in Java too if you want.
One of the main difference betwen oop and procedural programming is that in OOP, you can create OBJECTS and work with them easiliy which makes your life easier. in procedural programming, there are no so called Objects. So it is like you have to repeat most of the things again and again. Well...this is not a big explnation. You should know whatis an object to understand this.
this book called "head first java" answers your question with examples very nicely in their first pages. You should read it. At least first few pages to get a real answer.
nothing is purely oop or procedural.
IMHO Smalltalk is 100% OOP - no "primitives", no procedural language elements like if/else or do/while, just objects and message passing. But that's just my opinion...