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 are the differences between resultset and rowset?

748


What are the factors that the jdbc driver performance depends upon?

716


How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?

722


How to insert an image or raw data into database?

743


Where can I find ojdbc14 jar file?

697


What is a rollback in jdbc?

699


What is hbm xml?

655


What are the methods which can verify the cursor particular position?

757


Which is better odbc or jdbc?

663


Explain the process of creating tables using NetBeans IDE?

701


Is uri the same as url?

667


How do we call a stored procedure from jdbc?

739


How do I write Greek ( or other non-ASCII/8859-1 ) characters to a database?

780


What is statement and resultset in jdbc?

685


Jdbc-odbc bridge is multi-threaded or not?

720