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

Why do I get UnsatisfiedLinkError when I try to use my JDBC driver?

560


What is jdbc driver for sql server?

532


What are the different types of interfaces in the api component?

517


Explain the necessary steps to connect to the database in java?

548


What are the 4 types of jdbc drivers?

509






How many types of JDBC Drivers are present and what are they?

498


Why resultset is used in java?

502


How can we store the file in the oracle database?

518


What are the differences between execute, executequery, and executeupdate?

483


What causes the "No suitable driver" error?

534


What is difference between odbc and jdbc?

500


What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?

512


How can I instantiate and load a new CachedRowSet object from a non-JDBC source?

530


How many types of jdbc drivers are available?

488


Explain the importance of drivermanager.

708