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 are the packages are used in jdbc?

796


How do I stop nullpointerexception?

708


What is statement and resultset in jdbc?

703


List some new features available in jdbc 4.0?

684


How to insert an image or raw data into database?

758


What is 2 phase commit?

862


How do I set properties for a JDBC driver and where are the properties stored?

719


What is resultset?

757


How do I find ojdbc jar version?

695


Give a way to check that all result sets have bin accessed and update counts are generated by execute method.

695


What is type 4 jdbc driver?

666


What are the different types of drivers under jdbc?

659


Is uri the same as url?

683


What is meant by jdbc and odbc?

688


Name the types of jdbc drivers.

720