{"id":306,"date":"2023-08-03T19:12:37","date_gmt":"2023-08-03T18:12:37","guid":{"rendered":"https:\/\/bobtimetech.net\/?page_id=306"},"modified":"2025-05-15T10:55:14","modified_gmt":"2025-05-15T14:55:14","slug":"learning-java","status":"publish","type":"page","link":"https:\/\/bobtimetech.net\/index.php\/my-account\/learning-java\/","title":{"rendered":"Learning JAVA"},"content":{"rendered":"\n<div class=\"wp-block-group has-black-background-color has-background is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-b6c1f246 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group has-background-color has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-dc2fda857e80ea7c7d9271aab339488d\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-container-core-group-is-layout-23b1a4dc wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-columns alignfull are-vertically-aligned-center is-not-stacked-on-mobile has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 64%,rgb(107,0,62) 94%)\">\n<div class=\"wp-block-column is-vertically-aligned-center has-background is-layout-flow wp-block-column-is-layout-flow\" style=\"background-color:#f90202\"><div class=\"aligncenter wp-block-site-logo wp-duotone-unset-1\"><a aria-label=\"(Home link, opens in a new tab)\" target=\"_blank\" href=\"https:\/\/bobtimetech.net\/\" class=\"custom-logo-link\" rel=\"home\"><img decoding=\"async\" width=\"544\" height=\"545\" src=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png\" class=\"custom-logo\" alt=\"image of the Angel of Death standing victorious, symbolizing triumph and peace.\" srcset=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png 312w, https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel-300x300.png 300w, https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel-150x150.png 150w\" sizes=\"(max-width: 544px) 100vw, 544px\" data-attachment-id=\"4027\" data-permalink=\"https:\/\/bobtimetech.net\/one_angel\/cropped-one_angel-png\/\" data-orig-file=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png\" data-orig-size=\"312,313\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"cropped-One_Angel.png\" data-image-description=\"&lt;p&gt;BobTimeTech.net Logo. image of the Angel of Death standing victorious, symbolizing triumph and peace.&lt;\/p&gt;\n\" data-image-caption=\"\" data-large-file=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png\" \/><\/a><\/div>\n\n\n<h2 class=\"wp-block-heading has-text-align-center has-white-color has-text-color has-large-font-size\" id=\"aioseo-the-devil-is-in-the-details\" style=\"font-style:italic;font-weight:800;text-transform:uppercase\"><em>The Devil is in the details.<\/em><\/h2>\n<\/div>\n<\/div>\n<\/div><\/div>\n\n\n<div class=\"wp-block-aioseo-table-of-contents\"><ul><\/ul><\/div><\/div><\/div>\n<\/div>\n\n\n\n<div style=\"height:19px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/bobtimetech.net\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tLearning JAVA\n\t\t<\/span><\/div>\n\n\n<div style=\"height:28px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">What is Java?<\/span><\/strong><\/p>\n\n\n\n<p>Java is a versatile programming language that was created by James Gosling in 1995. It is known for its simplicity, readability, and platform independence, making it one of the most popular programming languages in the world.<\/p>\n\n\n\t<div class=\"wp-block-jetpack-gif alignleft\">\n\t\t<figure>\n\t\t\t\t\t\t\t<div class=\"wp-block-jetpack-gif-wrapper\" style=\"padding-top:56%\">\n\t\t\t\t\t<iframe src=\"https:\/\/giphy.com\/embed\/26tn33aiTi1jkl6H6\" title=\"JAVA code\"><\/iframe>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/figure>\n\t<\/div>\n\t\n\n\n<p><strong><span style=\"text-decoration: underline;\">Object-Oriented Programming Language<\/span><\/strong><\/p>\n\n\n\n<p>Java is an object-oriented programming language, which means it revolves around the concept of objects and classes. This paradigm allows developers to organize their code into reusable modules, making it easier to manage and maintain large software systems. With its robust class library and support for inheritance and polymorphism, Java provides developers with powerful tools for building complex applications.<\/p>\n\n\n\n<p>The syntax structure of Java can be considered verbose, as it tends to contain more words than necessary. In Java, all classes must start with uppercase letters. There is also the concept of packages, which is a way of organizing files and structuring code by grouping related classes. String literals are defined using double quotes &#8220;&#8221;, while character literals are defined using single quotes &#8221;.<\/p>\n\n\n\n<p>It is important to note that you cannot use reserved words in Java, such as byte, package, or public, as variable names or data types.<\/p>\n\n\n\n<p>In Java, variables act as placeholders where you can store values. Before declaring a variable, you need to decide on the data type you want to use. You can choose from primitive types (used only for numbers or individual characters), such as byte, short, int, long, float, double, boolean, and char. It&#8217;s worth noting that integer types (byte, short, int, long) allow you to store whole numbers without decimals, while floating-point types (float, double) allow you to store decimal numbers.<\/p>\n\n\n\n<p>On the other hand, there are also reference types, which are used to store more complex data, such as objects or custom data structures. To use a reference type, you need to create an instance using the &#8220;new&#8221; keyword, followed by the type name (for example, &#8220;new Date()&#8221;). Reference types always start with an uppercase letter, such as the String class, which allows you to store sequences of characters.<\/p>\n\n\n\n<p>When using reference type variables, you can access specific methods and behaviors using the &#8220;.&#8221; operator after the variable name (for example, &#8220;System.out.println(name.length())&#8221;). Choosing meaningful variable names is important, as they should reflect the content or purpose of the variable. In summary, understanding the syntax and data types in Java will allow you to write clearer and more readable programs.<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter\"><a id=\"wp-block-file--media-c4285027-e929-465e-9a3b-f5bc52c867bf\" href=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2023\/08\/Junit5-Udemy-Course-for-Beginners-Bob-Hogan-10.2022.docx\"><mark style=\"background-color:#3de533\" class=\"has-inline-color\"><strong>Junit5 Udemy Course for Beginners Bob Hogan 10.2022<\/strong><\/mark><\/a><a href=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2023\/08\/Junit5-Udemy-Course-for-Beginners-Bob-Hogan-10.2022.docx\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-c4285027-e929-465e-9a3b-f5bc52c867bf\">Download<\/a><\/div>\n\n\n\n<div style=\"height:38px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p><strong><span style=\"text-decoration: underline;\">JAVA Access Modifiers<\/span><\/strong> or <a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/java\/javaOO\/accesscontrol.html\" target=\"_blank\" rel=\"noopener\" title=\"\">Controlling Access to Members of a Class<\/a><\/p>\n\n\n\n<p>Access modifiers in Java are used to control the access to classes, variables, methods, and constructors. They define the visibility levels of the elements in a Java program.<\/p>\n\n\n\t<div class=\"wp-block-jetpack-gif alignright\">\n\t\t<figure>\n\t\t\t\t\t\t\t<div class=\"wp-block-jetpack-gif-wrapper\" style=\"padding-top:52%\">\n\t\t\t\t\t<iframe src=\"https:\/\/giphy.com\/embed\/TCDHJPxeWgTsY\" title=\"manage\"><\/iframe>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/figure>\n\t<\/div>\n\t\n\n\n<p>There are four access modifiers in Java:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><span class=\"highlight\"><strong>Public<\/strong>:<\/span> The element is accessible from anywhere, inside or outside the class. There are no restrictions on access.<\/li>\n\n\n\n<li><span class=\"highlight\"><strong>Protected<\/strong>: <\/span>The element is accessible within the same class, the same package, and subclasses in different packages.<\/li>\n\n\n\n<li><span class=\"highlight\"><strong>Default<\/strong> (or package-private)<\/span>: The element is accessible within the same class and the same package. This is the default modifier if no modifier is specified.<\/li>\n\n\n\n<li><strong><span class=\"highlight\">Private<\/span>:<\/strong> The element is only accessible within the same class. It is not visible outside the class, not even in subclasses of the same package.<\/li>\n<\/ul>\n\n\n\n<p>These access modifiers play a key role in class design and Java program development. They help define access restrictions and encapsulate the data and functionality of a program.<\/p>\n\n\n\n<p>Choosing the appropriate access modifier is important based on the design requirements of your program. Improper use of access modifiers can compromise the integrity and security of your code.<\/p>\n\n\n\n<p>In conclusion, access modifiers in Java provide an effective way to manage access to elements in a program. They control the visibility and accessibility of classes, variables, methods, and constructors, making code maintenance, reusability, and security easier.<\/p>\n\n\n\n<div style=\"height:73px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<\/div>\n<\/div>\n\n\n\n<div style=\"height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-group has-white-color has-black-background-color has-text-color has-background has-small-font-size\" style=\"min-height:40vh;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--50)\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-container-core-group-is-layout-ec5833f3 wp-block-group-is-layout-constrained\"><div style=\"margin-bottom:6px;\" class=\"aligncenter wp-block-site-logo\"><a href=\"https:\/\/bobtimetech.net\/\" class=\"custom-logo-link\" rel=\"home\"><img decoding=\"async\" width=\"490\" height=\"491\" src=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png\" class=\"custom-logo\" alt=\"image of the Angel of Death standing victorious, symbolizing triumph and peace.\" srcset=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png 312w, https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel-300x300.png 300w, https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel-150x150.png 150w\" sizes=\"(max-width: 490px) 100vw, 490px\" data-attachment-id=\"4027\" data-permalink=\"https:\/\/bobtimetech.net\/one_angel\/cropped-one_angel-png\/\" data-orig-file=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png\" data-orig-size=\"312,313\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"cropped-One_Angel.png\" data-image-description=\"&lt;p&gt;BobTimeTech.net Logo. image of the Angel of Death standing victorious, symbolizing triumph and peace.&lt;\/p&gt;\n\" data-image-caption=\"\" data-large-file=\"https:\/\/bobtimetech.net\/wp-content\/uploads\/2024\/10\/cropped-One_Angel.png\" \/><\/a><\/div>\n\n\n<div class=\"wp-block-group has-background\" style=\"background-color:#f60606\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"has-text-align-center has-white-color has-text-color has-link-color has-medium-font-size wp-elements-414061d41995b64af1b226e1d9236355\">Proudly powered by <a href=\"https:\/\/wordpress.org\" target=\"_blank\" rel=\"noopener\" title=\"\">WordPress<\/a><\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group has-header-gradient-background-color has-background\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<div style=\"height:36px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<\/div><\/div>\n\n\n\n<ul class=\"wp-block-social-links aligncenter has-large-icon-size is-style-logos-only is-nowrap is-layout-flex wp-container-core-social-links-is-layout-65900438 wp-block-social-links-is-layout-flex\"><li class=\"wp-social-link wp-social-link-linkedin  wp-block-social-link\"><a href=\"https:\/\/www.linkedin.com\/in\/robert-t-hogan-619806a4\" class=\"wp-block-social-link-anchor\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">LinkedIn<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-youtube  wp-block-social-link\"><a href=\"https:\/\/www.youtube.com\/channel\/UCuIiXVv392sbxvaUEnJVNaA\" class=\"wp-block-social-link-anchor\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">YouTube<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-mail  wp-block-social-link\"><a href=\"mailto:b&#111;b&#116;im&#101;t&#101;ch&#064;gm&#097;i&#108;&#046;&#099;&#111;m\" class=\"wp-block-social-link-anchor\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19,5H5c-1.1,0-2,.9-2,2v10c0,1.1.9,2,2,2h14c1.1,0,2-.9,2-2V7c0-1.1-.9-2-2-2zm.5,12c0,.3-.2.5-.5.5H5c-.3,0-.5-.2-.5-.5V9.8l7.5,5.6,7.5-5.6V17zm0-9.1L12,13.6,4.5,7.9V7c0-.3.2-.5.5-.5h14c.3,0,.5.2.5.5v.9z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">Mail<\/span><\/a><\/li><\/ul>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Devil is in the details. What is Java? Java is a versatile programming language that was created by James Gosling in 1995. It is known for its simplicity, readability, and platform independence, making it one of the most popular programming languages in the world. Object-Oriented Programming Language Java is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":8,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_themeisle_gutenberg_block_has_review":false,"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-306","page","type-page","status-publish","hentry"],"aioseo_notices":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/pages\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":1,"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/pages\/306\/revisions"}],"predecessor-version":[{"id":4146,"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/pages\/306\/revisions\/4146"}],"up":[{"embeddable":true,"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/pages\/8"}],"wp:attachment":[{"href":"https:\/\/bobtimetech.net\/index.php\/wp-json\/wp\/v2\/media?parent=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}