is java pure object oriented or not ?

Answer Posted / sathish.pk

java is not pure object oriented .

because, we are using "Static" keyword.

for example:
-------------
public class Sample{

public static void add(){
int a=1,b=2;
System.out.println("Add Value="+(a+b));
}

public void sub(){

int a=1,b=2;
System.out.println("Sub value="+(b-a));
}

public static void main(String args[]){

Sample sam=new Sample();
sam.sub();

Sample.add();
}
}


in above example:
------------------
we are creating object for access add() method, but

we are not creating object for access sub() method. because,
it is static method. so, here we are accessing add() method
without creating object. that all...

so, java is not pure object oriented ..

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is jdbc and jpa?

715


What is a jdbc connection?

670


How does JDBC API helps us in achieving loose coupling between Java Program and JDBC Drivers API?

854


How can we disable a constraint ?

782


RowSetInternal caller and returns void. What can I do in the readData method?

779


What is device controller?

721


Explain the difference between inner and outer join ?

724


What is JDBC RowSet? What are different types of RowSet?

798


Explain the role of driver in jdbc.

784


How many categories of jdbc drivers are there?

678


What are the differences between stored procedure and functions?

744


Is uri the same as url?

689


What are jdbc?

740


What causes the "No suitable driver" error?

750


What is Apache DBCP API?

785