{"id":67688,"date":"2021-07-27T04:10:07","date_gmt":"2021-07-27T08:10:07","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/java-some-basic-important-stuffs-computer-game-design-java-short-notes\/"},"modified":"2021-07-27T04:10:07","modified_gmt":"2021-07-27T08:10:07","slug":"java-some-basic-important-stuffs-computer-game-design-java-short-notes","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=67688","title":{"rendered":"Java: Some basic important stuffs #Computer Game Design #Java Short Notes"},"content":{"rendered":"<p><b>Data types to represent telephone numbers:<\/b><\/p>\n<p>a string of ten digits can represent all ten-digit telephone numbers.<br \/>an object can hold data (integers or strings) of the elements of a telephone number<br \/>an integer data type can represent all ten-digit numbers<br \/>&#8211;a boolean can only represent two values<br \/>an enumerated type can only represent a fixed number of constant<\/p>\n<p><b>Abstract Class:<\/b><\/p>\n<p>An abstract class may have constructors, but it is illegal to invoke the new operator on an abstract class<br \/>An abstract class is allowed to have method implementations<br \/>There is no restriction about the placement of abstract classes in a class hierarchy<br \/>It is legal for an abstract class to implement an interface and implement one or more interface methods<\/p>\n<p><b>Design a role player game:<\/b><\/p>\n<p>creating an abstract superclass for a generic player will simplify the design. <br \/>This is because the maintenance of the common methods will be simplified.<br \/>An abstract class is the perfect container, as a superclass, for the common methods <\/p>\n<p><b>Model<\/b><\/p>\n<p>A sports team with fixed number of players in which players may participate in other teams<br \/>a many-to-many association from players to team Will work<\/p>\n<p><b>Java Bean convention for setter methods<\/b><\/p>\n<p>void setFirstName(String value)<\/p>\n<p><b>Data Hiding<\/b><\/p>\n<p>A well-encapsulated class must have all of its attributes marked private.<br \/>A well-encapsulated class must hide all internal methods. This is because this is NOT part of the class&#8217;s public interface. <br \/>NOT all attributes require accessor or mutator methods.<\/p>\n<p><b>The principle of &#8220;programming to an interface&#8221;?<\/b><\/p>\n<p>Generalize the return type of a method. The return type of a method should be as abstract as possible, such that any object of that type could be returned. If a concrete class is used as the return type, then only an object of that type (or its subclasses) can be returned.<\/p>\n<p>A class hierarchy is a static part of the code structure. Polymorphism and program to an interface are principles that apply to the dynamic aspects of the code, such as the objects that are stored in variables and passed through methods.<\/p>\n<p>The parameter type of a method should be as abstract as possible, such that any object of that type could be passed in to the method. If a concrete class is used as the parameter type, then only an object of that type (or its subclasses) can be used as a parameter. <\/p>\n<p> The type of an instance variable should be as abstract as possible, such that any object of that type could be held by the owning object. If a concrete class is used as an instance variable type, then only an object of that type (or its subclasses) can be held in that variable. <\/p>\n<p> The relationship between classes and interfaces form only a static part of the code structure. Polymorphism and program to an interface are principles that apply to the dynamic aspects of the code<\/p>\n<p> From: http:\/\/sitestree.com\/?p=4844<br \/> Categories:Computer Game Design, Java Short Notes<br \/>Tags:<br \/> Post Data:2010-05-12 10:21:08<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data types to represent telephone numbers: a string of ten digits can represent all ten-digit telephone numbers.an object can hold data (integers or strings) of the elements of a telephone numberan integer data type can represent all ten-digit numbers&#8211;a boolean can only represent two valuesan enumerated type can only represent a fixed number of constant &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=67688\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-67688","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":66316,"url":"http:\/\/bangla.sitestree.com\/?p=66316","url_meta":{"origin":67688,"position":0},"title":"Java Fundamentals #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 18, 2021","format":false,"excerpt":"An abstract class may have constructors It is illegal to invoke the new operator on an abstract class An abstract class is allowed to have method implementations There is no restriction about the placement of abstract classes in a class hierarchy It is legal for an abstract class to implement\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65838,"url":"http:\/\/bangla.sitestree.com\/?p=65838","url_meta":{"origin":67688,"position":1},"title":"SCJP: Class Declarations #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"class declarations Start with modifiers such as public, private followed by class keyword The class name, with the initial letter capitalized The name of the class's parent (superclass), preceded by the keyword extends (if any). A class can only extend (subclass) one parent. list of interfaces implemented by the class,\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26565,"url":"http:\/\/bangla.sitestree.com\/?p=26565","url_meta":{"origin":67688,"position":2},"title":"Code examples for interfaces #Programming Code Examples #Java\/J2EE\/J2ME #Object Oriented Programming","author":"Author-Check- Article-or-Video","date":"April 28, 2021","format":false,"excerpt":"**************************** Code examples for interfaces: * Class1.java implements Interface1.java * Abstract Class2.java implements Interface1.java and Interface2.java * Class3.java extends abstract class Class2.java * Interface3.java extends Interface1.java and Interface2.java *************************** ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Class1.java ~~~~~~~~~~~~~~~~~~~~~~~~~~~ \/\/ This class is not abstract, so it must provide \/\/ implementations of method1 and method2. public class\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10536,"url":"http:\/\/bangla.sitestree.com\/?p=10536","url_meta":{"origin":67688,"position":3},"title":"Code examples for interfaces","author":"","date":"August 29, 2015","format":false,"excerpt":"**************************** Code examples for interfaces: \u00a0\u00a0\u00a0 * Class1.java implements Interface1.java \u00a0\u00a0\u00a0 * Abstract Class2.java implements Interface1.java and Interface2.java \u00a0\u00a0\u00a0 * Class3.java extends abstract class Class2.java \u00a0\u00a0\u00a0 * Interface3.java extends Interface1.java and Interface2.java *************************** ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Class1.java ~~~~~~~~~~~~~~~~~~~~~~~~~~~ \/\/ This class is not abstract, so it must provide \/\/ implementations of method1\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26567,"url":"http:\/\/bangla.sitestree.com\/?p=26567","url_meta":{"origin":67688,"position":4},"title":"Example illustrating inheritance and abstract classes #Programming Code Examples #Java\/J2EE\/J2ME #Object Oriented Programming","author":"Author-Check- Article-or-Video","date":"April 28, 2021","format":false,"excerpt":"*********************************** # Example illustrating inheritance and abstract classes. * Shape.java The parent class (abstract) for all closed, open, curved, and straight-edged shapes. * Curve.java An (abstract) curved Shape (open or closed). * StraightEdgedShape.java A Shape with straight edges (open or closed). * Measurable.java Interface defining classes with measurable areas. *\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70253,"url":"http:\/\/bangla.sitestree.com\/?p=70253","url_meta":{"origin":67688,"position":5},"title":"Financial Transaction: Java Data Type #1","author":"Author-Check- Article-or-Video","date":"August 30, 2021","format":false,"excerpt":"Best data type for Financial Transactions: Object with two integer type variables. One for the dollars and another for the cents. floating points are inappropriate as they suffer from round-off errors.For financial software how to create a common class for contracts that multiple independent classes will satisfy?Using interfacebecause for independent\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/67688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67688"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/67688\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67688"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}