{"id":65822,"date":"2021-07-15T04:10:07","date_gmt":"2021-07-15T08:10:07","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/scjp-language-fundamentals-java-short-notes-scjp\/"},"modified":"2022-05-10T20:04:10","modified_gmt":"2022-05-11T00:04:10","slug":"scjp-language-fundamentals-java-short-notes-scjp","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=65822","title":{"rendered":"SCJP: Language Fundamentals #Java Short Notes #SCJP"},"content":{"rendered":"<p><b>Class declaration and java source file.<\/b><\/p>\n<ul>\n<li> Only &#8220;one&#8221; top-level public class is allowed per java source file. <\/li>\n<li> The name of the java source file and the name of the top-level public class MUST be the same. <\/li>\n<li> If no public class is there in a file, after compiling separate class files will be created for all classes in the file.  <\/li>\n<li> Package statement, import statements and class definition MUST appear in the order given.<\/li>\n<\/ul>\n<p><b>Keywords and Identifiers<\/b><\/p>\n<ul>\n<li> Keywords are always in a lower case.  <\/li>\n<li> Some keywords: const, goto, strictfp, and volatile   <\/li>\n<li> Identifiers must start with either letter, $ or _ (underscore) and can have letter, $, _ or digits in it.  <\/li>\n<li>\tno keyword is allowed as identifiers<\/li>\n<\/ul>\n<table cellspacing=\"0\" cellpadding=\"5\" align='center' style='padding-left:15px'>\n<tr>\n<td>          abstract        <\/td>\n<td>          do        <\/td>\n<td>          import        <\/td>\n<td>          public        <\/td>\n<td>          transient        <\/td>\n<\/tr>\n<tr>\n<td>          boolean        <\/td>\n<td>          double        <\/td>\n<td>          instanceof        <\/td>\n<td>          return        <\/td>\n<td>          try        <\/td>\n<\/tr>\n<tr>\n<td>          break        <\/td>\n<td>          else        <\/td>\n<td>          int        <\/td>\n<td>          short        <\/td>\n<td>          void        <\/td>\n<\/tr>\n<tr>\n<td>          byte        <\/td>\n<td>          extends        <\/td>\n<td>          interface        <\/td>\n<td>          static        <\/td>\n<td>          volatile        <\/td>\n<\/tr>\n<tr>\n<td>          case        <\/td>\n<td>          final        <\/td>\n<td>          long        <\/td>\n<td>          super        <\/td>\n<td>          while        <\/td>\n<\/tr>\n<tr>\n<td>          catch        <\/td>\n<td>          finally        <\/td>\n<td>          native        <\/td>\n<td>          switch        <\/td>\n<td>        <\/td>\n<\/tr>\n<tr>\n<td>          char        <\/td>\n<td>          float        <\/td>\n<td>          new        <\/td>\n<td>          synchronized        <\/td>\n<td>        <\/td>\n<\/tr>\n<tr>\n<td>          class        <\/td>\n<td>          for        <\/td>\n<td>          package        <\/td>\n<td>          this        <\/td>\n<td>        <\/td>\n<\/tr>\n<tr>\n<td>          continue        <\/td>\n<td>          if        <\/td>\n<td>          private        <\/td>\n<td>          throw        <\/td>\n<td>        <\/td>\n<\/tr>\n<tr>\n<td>          default        <\/td>\n<td>          implements        <\/td>\n<td>          protected        <\/td>\n<td>          throws        <\/td>\n<td>        <\/td>\n<\/tr>\n<\/table>\n<p><b>Default Values, Local Variables<\/b><\/p>\n<ul>\n<li> Each primitive data type has a default value       specified. Variable of primitive data type may be       initialized       <\/li>\n<li> Only class member variables are automatically           initialized. Method variables need explicit           initialization       <\/li>\n<li> Local variables (also known as automatic           variables) are declared in methods and in code           blocks        <\/li>\n<li> Automatic variables are not automatically initialized \t<\/li>\n<li> local variables should be explicitly initialized before first use. These are automatically destroyed when they  go out of scope<\/li>\n<\/ul>\n<p><b>Arrays<\/b><\/p>\n<ul>\n<li> Fixed-sized ordered collection of homogeneous data elements <br \/> int[] ints;          \/\/ array declaration <br \/> ints = new ints[25]; \/\/ array construction at runtime.\n<\/li>\n<li>Array declared, constructed and initialized at the same time.<br \/> int[] ints = {1,2,3,4,5}; \/\/ array declaration, <\/li>\n<li> An array of primitive data type created using the new keyword is automatically initialized. Each array element is initialized to its default value. <br \/>For example,<br \/> char[] arrayOfChars = new char[10];\n<\/li>\n<li>Array of object references: An array of object references created using the new keyword is also initialized. Each array element is initialized to its default value, i.e. null.<br \/>String[] names = new String[10];<\/li>\n<li> length is a property of array (and not a method)<\/li>\n<li> java.lang.Object is the superclass of an array<\/li>\n<\/ul>\n<p><b>Argument passing during method calls<\/b><\/p>\n<ul>\n<li> Always a copy of argument value is passed to calling  method  <\/li>\n<li> Arguments of primitive data types: first, a copy of the passing variable is made and then it is passed. The original copy remains unaffected  <\/li>\n<li> Object reference as an argument: A copy of object reference is passed for method calls. It still points to the same object. The original copy is affected. <\/li>\n<\/ul>\n<p> From: http:\/\/sitestree.com\/?p=4862<br \/> Categories:Java Short Notes, SCJP<br \/>Tags:<br \/> Post Data:2008-07-28 12:18:41<\/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>Class declaration and java source file. Only &#8220;one&#8221; 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 will be created for all &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=65822\">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-65822","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":65864,"url":"http:\/\/bangla.sitestree.com\/?p=65864","url_meta":{"origin":65822,"position":0},"title":"SCJP Training: Lesson 3: API Contents #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"The Number Classes Characters Strings The StringBuilder Class Character Streams (FileReader, FileWriter) Buffered Streams (BufferedReader, BufferedWriter) Formatting (PrintWriter) File Objects (File) Data Streams Object Streams Manipulating Characters in a String (String split method) Methods of the Pattern Class Methods of the Matcher Class Scanning Formatting Formatting (PrintWriter, formatting parameters) Formatting\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":65836,"url":"http:\/\/bangla.sitestree.com\/?p=65836","url_meta":{"origin":65822,"position":1},"title":"SCJP: Flow controls and exception #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"Flow Control and ExceptionsFlow control statements Conditional: if, if-else and switch-case Looping: for, while, do-while Exception handling: try-catch-finally, throw Ad hoc flow control: break, continue with or without labelsswitch statement switch(expression){ case ConstantExpression: statement(s); case ConstantExpression: statement(s); . . . default: statement(s); } expression: must be char, byte, short, or\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":65858,"url":"http:\/\/bangla.sitestree.com\/?p=65858","url_meta":{"origin":65822,"position":2},"title":"SCJP Essential Knowledge #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"int x=5; String y=\"3\"; 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\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":65854,"url":"http:\/\/bangla.sitestree.com\/?p=65854","url_meta":{"origin":65822,"position":3},"title":"SCJP: More Rules #Java Short Notes #SCJP","author":"Sayed","date":"July 16, 2021","format":false,"excerpt":"java -classpath gFolder\/Game.jar civilization.java: In such command, -classpath will override (replace) CLASSPATH environment variable. java -classpath gFolder\/Game.jar civilization.java: if both gFolder and current directory contain Game.jar then the jar file under gFolder will be used. If you want java compiler to recognize your jar file, either you have to mention\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":65818,"url":"http:\/\/bangla.sitestree.com\/?p=65818","url_meta":{"origin":65822,"position":4},"title":"SCJP: Classpath and Jar #Java Short Notes #SCJP #Blog","author":"Sayed","date":"July 15, 2021","format":false,"excerpt":"Java certification exams like SCJP test your knowledge about java classpath. Check here for an excellent resource on the topic . System classpathWe can specify classpath in the command line or make use of a `system' class path. The IDEs have their own way of maintaining class paths. System 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":22132,"url":"http:\/\/bangla.sitestree.com\/?p=22132","url_meta":{"origin":65822,"position":5},"title":"SCJP: Sun Certified Java Programmer: All that you need to know #SCJP","author":"Sayed","date":"March 10, 2021","format":false,"excerpt":"Introduction to Sun Certified Java Programmer Certification CourseJava : SCJP: Important ResourcesJAVA: Some links: useful for exams like scjp\/scjaSCJP Essential KnowledgeSCJP Practice ExamsSCJP Training: Lesson 1: Develop code that declares classes (including abstract and all forms of nested classes), interfaces, and enums, and includes the appropriate use of package and\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\/65822","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=65822"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65822\/revisions"}],"predecessor-version":[{"id":74749,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/65822\/revisions\/74749"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65822"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}