{"id":65858,"date":"2021-07-16T22:44:07","date_gmt":"2021-07-17T02:44:07","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/scjp-essential-knowledge-java-short-notes-scjp\/"},"modified":"2022-05-10T20:04:07","modified_gmt":"2022-05-11T00:04:07","slug":"scjp-essential-knowledge-java-short-notes-scjp","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=65858","title":{"rendered":"SCJP Essential Knowledge #Java Short Notes #SCJP"},"content":{"rendered":"<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>int x=5; String y=&#8221;3&#8243;; System.out.print(x + 1 + y); Output: 63<\/li>\n<li>When there is no live reference to an object, the object becomes eligible for garbage collection.<\/li>\n<li>The concrete interface method implementation must be public.<\/li>\n<li>When a class implements Comparator, it must implement a compare method.<\/li>\n<li>When a class implements Comparable, it must implement a compareTo method.<\/li>\n<li>The Arrays.asList() method creates a fixed-size list<\/li>\n<li>A method like void go(Set a) can be called with objects created as: TreeSet t = new TreeSet(); TreeSet t = new TreeSet();. Remember, TreeSet t = new TreeSet(); TreeSet t = new TreeSet(); will not work where Dog is a sub-class of Animal.<\/li>\n<li>When two enums are equal, both .equals and == always return true.<\/li>\n<li>TreeSet is ordered in their natural order or according to the Comparator provided at creation.<\/li>\n<li>SortedMaps are abstract<\/li>\n<li>Is-a relationships can use inheritance<\/li>\n<li>Tightly encapsulated classes can have a has-a relationship<\/li>\n<li>is-a or has-a relationships does not apply to methods<\/li>\n<li>java command in details:\n<pre>Usage: java [-options] class [args...]           (to execute a class)   or  java [-options] -jar jarfile [args...]           (to execute a jar file)where options include:    -client\t  to select the \"client\" VM    -server\t  to select the \"server\" VM    -hotspot\t  is a synonym for the \"client\" VM  [deprecated]                  The default VM is client.                      -cp     -classpath                   A ; separated list of directories, JAR archives,                  and ZIP archives to search for class files.    -D=                  set a system property    -verbose[:class|gc|jni]                  enable verbose output    -version      print product version and exit    -version:                  require the specified version to run    -showversion  print product version and continue    -jre-restrict-search | -jre-no-restrict-search                  include\/exclude user private JREs in the version search    -? -help      print this help message    -X            print help on non-standard options    -ea[:...|:]    -enableassertions[:...|:]                  enable assertions    -da[:...|:]    -disableassertions[:...|:]                  disable assertions    -esa | -enablesystemassertions                  enable system assertions    -dsa | -disablesystemassertions                  disable system assertions    -agentlib:[=]                  load native agent library , e.g. -agentlib:hprof                    see also, -agentlib:jdwp=help and -agentlib:hprof=help    -agentpath:[=]                  load native agent library by full pathname    -javaagent:[=]                  load Java programming language agent, see java.lang.instrument<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p> From: http:\/\/sitestree.com\/?p=4893<br \/> Categories:Java Short Notes, SCJP<br \/>Tags:<br \/> Post Data:2008-03-02 15:26:47<\/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>int x=5; String y=&#8221;3&#8243;; System.out.print(x + 1 + y); Output: 63 When there is no live reference to an object, the object becomes eligible for garbage collection. The concrete interface method implementation must be public. When a class implements Comparator, it must implement a compare method. When a class implements Comparable, it must implement a &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=65858\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917,1954],"tags":[],"class_list":["post-65858","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","category-scjp-ocjp","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":65876,"url":"http:\/\/bangla.sitestree.com\/?p=65876","url_meta":{"origin":65858,"position":0},"title":"Set, TreeSet, Iterator in Java #Java Short Notes #Blog","author":"Author-Check- Article-or-Video","date":"July 16, 2021","format":false,"excerpt":"\/* * TreeSetExample.java * *Illustrates mathematical set operations * * Created on January 10, 2008, 9:28 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. *\/package treesetexample;import java.util.Set;import java.util.TreeSet;import java.util.Iterator;\/** * * @author Sayed *\/public class TreeSetExample { \/**\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":65852,"url":"http:\/\/bangla.sitestree.com\/?p=65852","url_meta":{"origin":65858,"position":1},"title":"SCJP: Short Notes #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"For the package package com.sun2;public enum Seasons {SUMMER, FALL, WINTER, SPRING} Valid import statements are:import com.sun2.Seasons; \/\/ the class import static com.sun2.Seasons.*; \/\/all enum valuesimport static com.sun2.Seasons.FALL; \/\/only one enum value An interface can extend many interfacesInterfaces can have variables, overrides and overloads An enum can have methods and can\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":65844,"url":"http:\/\/bangla.sitestree.com\/?p=65844","url_meta":{"origin":65858,"position":2},"title":"Java : SCJP: Important Resources #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"How to use generics to avoid runtime errors. More Generics Class casting in Java: How to avoid runtime exception - ClassCastException: overloading, overriding, variable and method hiding Java HotSpot virtual machine What Java Technology can do? Offers from Java Technology Java:Common Problems (and Their Solutions) Benefits of OOP: Modularity, Information-hiding,\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":65858,"position":3},"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":65842,"url":"http:\/\/bangla.sitestree.com\/?p=65842","url_meta":{"origin":65858,"position":4},"title":"SCJP: Random Stuffs #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"An enum may NOT be declared in a method An enum can be imported If the JVM has a choice, it will select a method without varargs before selecting a method with varargs When enums are equal, both .equals and == always return true The headMap() method returns the portion\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":65822,"url":"http:\/\/bangla.sitestree.com\/?p=65822","url_meta":{"origin":65858,"position":5},"title":"SCJP: Language Fundamentals #Java Short Notes #SCJP","author":"Sayed","date":"July 15, 2021","format":false,"excerpt":"Class declaration and java source file. Only \"one\" top-level public class is allowed per java source file. The name of the java source file and the name of the top-level public class MUST be the same. If no public class is there in a file, after compiling separate class files\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\/65858","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\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65858"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65858\/revisions"}],"predecessor-version":[{"id":74735,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65858\/revisions\/74735"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65858"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}