{"id":21646,"date":"2017-12-14T07:11:31","date_gmt":"2017-12-14T07:11:31","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=21646"},"modified":"2024-11-16T14:41:10","modified_gmt":"2024-11-16T14:41:10","slug":"why-java-is-not-a-pure-object-oriented-language","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/why-java-is-not-a-pure-object-oriented-language\/","title":{"rendered":"Why Java is not a pure Object-Oriented Language?"},"content":{"rendered":"<h1>Overview<\/h1>\n<p>Java is an OOP language, but it&#8217;s not a pure object-oriented language.<br \/>\nThere are some qualities to be satisfied for a programming language to be pure Object Oriented.<\/p>\n<p>Everything should be an object. For example, all types defined in the programming language should be treated as objects.<\/p>\n<h2>Java treats primitives as non-objects<\/h2>\n<p>Java is not a pure object-oriented programming language because it supports primitive data types such as byte, char, int, long\u2026 etc, which are not objects. In the Java programming language, we treat primitive data types as non-objects.<\/p>\n<p>To overcome this, Java introduced Wrapper classes like Character, Integer, Float, Double, etc. These are wrapper classes for the corresponding primitive types. Using wrapper classes we can treat the primitives as objects.<\/p>\n<h2>Example of Pure objected-oriented<\/h2>\n<p>An example of a pure object-oriented programming language is Smalltalk. In Smalltalk, there are no primitive types and all types are treated as objects.<\/p>\n<p>Squeak the modern implementation of Smalltalk is another example of pure OO language.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Java is an OOP language, but it&#8217;s not a pure object-oriented language. There are some qualities to be satisfied for a programming language to be pure Object Oriented. Everything should be an object. For example, all types defined in the programming language should be treated as objects. Java treats primitives as non-objects Java is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-21646","post","type-post","status-publish","format-standard","hentry","category-java","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/21646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=21646"}],"version-history":[{"count":8,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/21646\/revisions"}],"predecessor-version":[{"id":23223,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/21646\/revisions\/23223"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=21646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=21646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=21646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}