{"id":1028,"date":"2023-05-21T05:18:41","date_gmt":"2023-05-21T05:18:41","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1028"},"modified":"2023-05-21T05:20:29","modified_gmt":"2023-05-21T05:20:29","slug":"what-is-a-class","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/what-is-a-class\/","title":{"rendered":"What is a Class?"},"content":{"rendered":"\n<p>All Java codes are defined in a Class. It has variables and methods.<\/p>\n\n\n\n<p><strong>Variables&nbsp;<\/strong>are attributes which define the state of a class.<\/p>\n\n\n\n<p><strong>Methods<\/strong>&nbsp;are the place where the exact business logic has to be done. It contains a set of statements (or) instructions to satisfy the particular requirement.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><code>public class Addition{ \/\/Class name declaration<\/code><br><code>int a = 5; \/\/Variable declaration<\/code><br><code>int b = 5; <\/code><br><code>public void add(){ \/\/Method declaration<\/code><br><code>  int c = a+b;<\/code><br><code>}<\/code><br><code>}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>All Java codes are defined in a Class. It has variables and methods. Variables&nbsp;are attributes&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1028"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=1028"}],"version-history":[{"count":1,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1028\/revisions"}],"predecessor-version":[{"id":1029,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1028\/revisions\/1029"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}