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 sub() method
without creating object. that all...

so, java is not pure object oriented ..

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between executing, executequery, executeupdate in jdbc?

754


How to rollback a JDBC transaction?

766


What are the differences between setmaxrows(int) and setfetchsize(int)?

789


What is com mysql jdbc driver?

705


What are jdbc?

720


What is JDBC DataSource and what are it’s benefits?

732


What is the purpose of jdbc resultset interface?

768


Explain the difference between resultset and rowset in jdbc

757


Where is jdbc url mysql?

700


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

790


How MS-Access DB can be accessed over a network, using JDBC API?

2197


What is thin driver in jdbc?

721


Which is better jpa or jdbc?

687


What is jdbc odbc bridge in java?

763


What is two-phase commit in the database?

723