{"id":8472,"date":"2021-08-01T12:01:17","date_gmt":"2021-08-01T12:01:17","guid":{"rendered":"https:\/\/exceptionly.com\/?p=8472"},"modified":"2022-06-29T16:42:44","modified_gmt":"2022-06-29T16:42:44","slug":"5-top-common-mistakes-every-beginner-java-programmer-makes","status":"publish","type":"post","link":"https:\/\/exceptionly.com\/ar\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/","title":{"rendered":"5 Top Common Mistakes Every Beginner Java Programmer Makes"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"8472\" class=\"elementor elementor-8472\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0b63278 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0b63278\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6a0ff14\" data-id=\"6a0ff14\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2912869 elementor-widget elementor-widget-text-editor\" data-id=\"2912869\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>As a Java Programmer, I remember the first time I was in an algorithm lecture at college with around 40 students. The lecturer was trying to explain how each of us is unique and different. Even for one of the simplest algorithms, each of you will build a different way to implement it. Never forget that people think differently, so the way you implement a program will be different.\u00a0<\/p><p>Considering that approach, it makes sense to say there is no single correct way to implement a program in Java or any other language, but rather there are best practices.\u00a0<\/p><p>This tutorial aims to provide some examples of mistakes along with best practices in the Java language.\u00a0<\/p><p>Tutorial Level: BEGINNER.<\/p><h2>Missing Break Statement In a Switch-case Construct<\/h2><p>Switch case statements are designed to execute only one particular case based on the switch expression. If you don&#8217;t break after each case, the program will execute all case statements after the first match until it finds the next break or reaches the end of the statement.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9b030c2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9b030c2\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3d1caf8\" data-id=\"3d1caf8\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b101c51 elementor-widget elementor-widget-code-highlight\" data-id=\"b101c51\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-dark copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java\">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>public static void main(String[] args) {\n        switchCaseExample(2);\n    }\n\n private static void switchCaseExample(int month){\n        switch(month) {\n            case 1:\n                System.out.println(\"January\");\n            case 2:\n                System.out.println(\"February\");\n            case 3:\n                System.out.println(\"March\");\n            default:\n                System.out.println(\"Invalid Month!\");\n        }\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c4037db elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c4037db\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d0d241a\" data-id=\"d0d241a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-ed83241 elementor-widget elementor-widget-code-highlight\" data-id=\"ed83241\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-dark\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java\">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>\/\/ Output\nFebruary\nMarch\nInvalid Month!<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1b9f1a3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1b9f1a3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3148da0\" data-id=\"3148da0\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c996f7c elementor-widget elementor-widget-text-editor\" data-id=\"c996f7c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>Defining Unnecessary Instance Variables As a Java Programmer<\/h2><p>Instance variables are used to hold values for objects states. Those variables are without the STATIC keyword and defined in a class outside any methods. They are supposed to be used by more than one method. They are so-called because their values will be different for each instance of that class.\u00a0<\/p><p>Instance variables are created with a new class instance and destroyed by the garbage collector when there aren&#8217;t any references. Those variables will be alive during all instance lifecycles even if you don&#8217;t need them, and this is such an expensive process. However, local variables are destroyed automatically when the method call ends.\u00a0\u00a0<\/p><p>Local variables in methods always should be preferred since we want to keep each variable&#8217;s scope as short as possible.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-628bbf3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"628bbf3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-71f6ffb\" data-id=\"71f6ffb\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-32a7d24 elementor-widget elementor-widget-code-highlight\" data-id=\"32a7d24\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-dark copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java\">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>public class CoffeeChart {\n    private int foam;\/\/ this instance variable is visible in CoffeeChart class only.\n    public int espresso;\/\/ this instance variable is visible for any child class.\n \n    public static void main(String[] args) {\n    }\n}\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f057c7c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f057c7c\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9e50fcf\" data-id=\"9e50fcf\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4ee8021 elementor-widget elementor-widget-text-editor\" data-id=\"4ee8021\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>Comparing Object Data Types Inappropriately<\/h2>\n<p>Object data types are also called Non-primitive or Reference Data Types.<\/p>\n<p>The reference of an object is stored in the stack, but the original object value will be stored in heap, so comparing two instances of an Object with equality&nbsp; == will compare locations in memory but not actual values.&nbsp;<\/p>\n<p>Examples: String, Integer, Boolean, Double, BigDecimal, Array, List, Set, Stack, Vector, Classes, Interfaces<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a827d30 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a827d30\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-88b4800\" data-id=\"88b4800\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-78dcccb elementor-widget elementor-widget-code-highlight\" data-id=\"78dcccb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-dark copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java\">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>\nString name1 = new String(\"Fatma\");\nString name2 = new String(\"Fatma\");\n\nif (name1 == name2) {  \n  \/\/ name1 and name2 are not equals\n}\n\nif (name1 != null &amp;&amp; name1.equals(name2)) { \n   \/\/ name1 and name2 are equals\"\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-025a200 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"025a200\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-353755d\" data-id=\"353755d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d30455c elementor-widget elementor-widget-text-editor\" data-id=\"d30455c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>Returning Null In Java<\/h2><p>The NULL reference is the misguided invention of British computer scientist Tony Hoare; he described this situation at a software conference in 2009 as \u201c<a href=\"https:\/\/en.wikipedia.org\/wiki\/Tony_Hoare\">I call it my billion-dollar mistake<\/a>.\u201d<\/p><p>Using null is that you need to check for its null case every time to avoid future problems. This will bring a null-oriented design.\u00a0 Luckily all languages are now trying to solve the null problems with alternatives. For example, in Java 8, you can use the Optional type instead of null to point out that a value may or may not be present.<\/p><h2>Exception Handling Mistakes of Java Programmers<\/h2><p dir=\"ltr\">Exception handling in Java is not the easiest task you may face. However, even pro developers can spend hours finding the best ways of exception handling.<\/p><h3>Catching Exception Class<\/h3><p dir=\"ltr\">Catching Exception will catch all RuntimeExceptions. And when catching an exception, you are supposed to handle it properly; hence may not be able to deal with them to adjust the code. So the general principle is to catch the most specific exceptions you can.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5c3994f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5c3994f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-96556bd\" data-id=\"96556bd\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-13213db elementor-widget elementor-widget-code-highlight\" data-id=\"13213db\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-dark copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java\">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>try {\n   \/\/some code that throws an exception\n} catch (Exception e) {\n}\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a886ed3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a886ed3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5af543f\" data-id=\"5af543f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b8e9549 elementor-widget elementor-widget-text-editor\" data-id=\"b8e9549\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>Swallowing Exceptions<\/h3><p dir=\"ltr\">Swallowing an exception is an act of catching an exception but doing nothing to fix the issue.\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c98f765 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c98f765\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-637006f\" data-id=\"637006f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e2d73a9 elementor-widget elementor-widget-code-highlight\" data-id=\"e2d73a9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-dark copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java\">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>try {\n   \/\/some code that throws an exception\n} catch (IOException e) {\n}\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-bdae52c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bdae52c\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ec559c8\" data-id=\"ec559c8\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-cf89513 elementor-widget elementor-widget-text-editor\" data-id=\"cf89513\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>This is legit by syntax, the compiler will not complain, but that does not make this code piece any good.\u00a0\u00a0<\/p><p>While the exception is caught, we do nothing to fix the problem and losing a piece of useful information from the exception.\u00a0<\/p><p>There are several common mistakes and best practices you should consider when implementing a program. That helps you to avoid common bugs and to implement applications that are easy to maintain. Understanding the problem you are trying to solve is the first step of implementation. Next, write good code that is easy to understand and modify by other developers.<\/p><p>If this list of common mistakes was a bit deep-dive for you, you could take a look at my <a href=\"https:\/\/exceptionly.com\/ar\/2021\/07\/07\/how-to-start-coding-java-in-60-minutes\/\">Java in 60 minutes<\/a> post. It provides you an overall about \u201chow to build your first Java program.\u201d If you are into Python, no worries, I&#8217;ve published a &#8220;<a href=\"https:\/\/exceptionly.com\/ar\/2021\/07\/21\/how-to-start-coding-python-in-60-minutes\/\" target=\"_blank\" rel=\"noopener\">Python in 60 minutes<\/a>&#8221; post too.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>As a Java Programmer, I remember the first time I was in an algorithm lecture at college with around 40 students. The lecturer was trying to explain how each of us is unique and different. Even for one of the simplest algorithms, each of you will build a different way to implement it. Never forget [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":8501,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[206,97,96,98,99,143,100,89],"class_list":["post-8472","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-backend","tag-begineer-developers","tag-common-mistakes-in-java","tag-exception-handling","tag-instance-variables","tag-java","tag-java-interview-questions","tag-java-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.5 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>5 Top Common Mistakes Every Beginner Java Programmer Makes - Exceptionly<\/title>\n<meta name=\"description\" content=\"Common Mistakes Every Beginner Java Programmer Makes- Exceptionly is creating content for enabling beginner java programmers to start painless\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceptionly.com\/ar\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/\" \/>\n<meta property=\"og:locale\" content=\"ar_AR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 Top Common Mistakes Every Beginner Java Programmer Makes\" \/>\n<meta property=\"og:description\" content=\"As a Java Programmer, I remember the first time I was in an algorithm lecture at college with around 40 students. The lecturer was trying to explain how\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceptionly.com\/ar\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/\" \/>\n<meta property=\"og:site_name\" content=\"Exceptionly\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/exceptionly\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-01T12:01:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-29T16:42:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/08\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1930\" \/>\n\t<meta property=\"og:image:height\" content=\"766\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fatma Elverir\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@exceptionly\" \/>\n<meta name=\"twitter:site\" content=\"@exceptionly\" \/>\n<meta name=\"twitter:label1\" content=\"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatma Elverir\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u062f\u0642\u0627\u0626\u0642\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/\"},\"author\":{\"name\":\"Fatma Elverir\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/person\\\/a2600170dfb4513350affede916c0ccf\"},\"headline\":\"5 Top Common Mistakes Every Beginner Java Programmer Makes\",\"datePublished\":\"2021-08-01T12:01:17+00:00\",\"dateModified\":\"2022-06-29T16:42:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/\"},\"wordCount\":737,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg\",\"keywords\":[\"Backend\",\"Begineer Developers\",\"Common Mistakes In Java\",\"Exception handling\",\"Instance Variables\",\"Java\",\"Java Interview Questions\",\"Java Tutorials\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/\",\"name\":\"5 Top Common Mistakes Every Beginner Java Programmer Makes - Exceptionly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg\",\"datePublished\":\"2021-08-01T12:01:17+00:00\",\"dateModified\":\"2022-06-29T16:42:44+00:00\",\"description\":\"Common Mistakes Every Beginner Java Programmer Makes- Exceptionly is creating content for enabling beginner java programmers to start painless\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#breadcrumb\"},\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#primaryimage\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg\",\"contentUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg\",\"width\":1930,\"height\":766,\"caption\":\"5 Top Common Mistakes Every Beginner Java Programmer Makes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2021\\\/08\\\/01\\\/5-top-common-mistakes-every-beginner-java-programmer-makes\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/exceptionly.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"5 Top Common Mistakes Every Beginner Java Programmer Makes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#website\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/\",\"name\":\"Exceptionly\",\"description\":\"Remote software talent acquisition at scale\",\"publisher\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/exceptionly.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ar\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\",\"name\":\"Exceptionly\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/exceptionly-search-logo.png\",\"contentUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/exceptionly-search-logo.png\",\"width\":400,\"height\":400,\"caption\":\"Exceptionly\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/exceptionly\\\/\",\"https:\\\/\\\/x.com\\\/exceptionly\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/exceptionly\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCet5wATTyif6knI0h4vUkNA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/person\\\/a2600170dfb4513350affede916c0ccf\",\"name\":\"Fatma Elverir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"caption\":\"Fatma Elverir\"},\"sameAs\":[\"https:\\\/\\\/exceptionly.com\"],\"url\":\"https:\\\/\\\/exceptionly.com\\\/ar\\\/author\\\/fatmaelverir\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"5 Top Common Mistakes Every Beginner Java Programmer Makes - Exceptionly","description":"Common Mistakes Every Beginner Java Programmer Makes- Exceptionly is creating content for enabling beginner java programmers to start painless","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/exceptionly.com\/ar\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/","og_locale":"ar_AR","og_type":"article","og_title":"5 Top Common Mistakes Every Beginner Java Programmer Makes","og_description":"As a Java Programmer, I remember the first time I was in an algorithm lecture at college with around 40 students. The lecturer was trying to explain how","og_url":"https:\/\/exceptionly.com\/ar\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/","og_site_name":"Exceptionly","article_publisher":"https:\/\/www.facebook.com\/exceptionly\/","article_published_time":"2021-08-01T12:01:17+00:00","article_modified_time":"2022-06-29T16:42:44+00:00","og_image":[{"width":1930,"height":766,"url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/08\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg","type":"image\/jpeg"}],"author":"Fatma Elverir","twitter_card":"summary_large_image","twitter_creator":"@exceptionly","twitter_site":"@exceptionly","twitter_misc":{"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629":"Fatma Elverir","\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631":"4 \u062f\u0642\u0627\u0626\u0642"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#article","isPartOf":{"@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/"},"author":{"name":"Fatma Elverir","@id":"https:\/\/exceptionly.com\/#\/schema\/person\/a2600170dfb4513350affede916c0ccf"},"headline":"5 Top Common Mistakes Every Beginner Java Programmer Makes","datePublished":"2021-08-01T12:01:17+00:00","dateModified":"2022-06-29T16:42:44+00:00","mainEntityOfPage":{"@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/"},"wordCount":737,"commentCount":5,"publisher":{"@id":"https:\/\/exceptionly.com\/#organization"},"image":{"@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#primaryimage"},"thumbnailUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/08\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg","keywords":["Backend","Begineer Developers","Common Mistakes In Java","Exception handling","Instance Variables","Java","Java Interview Questions","Java Tutorials"],"articleSection":["Tutorials"],"inLanguage":"ar","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/","url":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/","name":"5 Top Common Mistakes Every Beginner Java Programmer Makes - Exceptionly","isPartOf":{"@id":"https:\/\/exceptionly.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#primaryimage"},"image":{"@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#primaryimage"},"thumbnailUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/08\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg","datePublished":"2021-08-01T12:01:17+00:00","dateModified":"2022-06-29T16:42:44+00:00","description":"Common Mistakes Every Beginner Java Programmer Makes- Exceptionly is creating content for enabling beginner java programmers to start painless","breadcrumb":{"@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#breadcrumb"},"inLanguage":"ar","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/"]}]},{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#primaryimage","url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/08\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg","contentUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/08\/5-Top-Common-Mistakes-Every-Beginner-Java-Programmer-Makes.jpg","width":1930,"height":766,"caption":"5 Top Common Mistakes Every Beginner Java Programmer Makes"},{"@type":"BreadcrumbList","@id":"https:\/\/exceptionly.com\/2021\/08\/01\/5-top-common-mistakes-every-beginner-java-programmer-makes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/exceptionly.com\/"},{"@type":"ListItem","position":2,"name":"5 Top Common Mistakes Every Beginner Java Programmer Makes"}]},{"@type":"WebSite","@id":"https:\/\/exceptionly.com\/#website","url":"https:\/\/exceptionly.com\/","name":"Exceptionly","description":"Remote software talent acquisition at scale","publisher":{"@id":"https:\/\/exceptionly.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceptionly.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ar"},{"@type":"Organization","@id":"https:\/\/exceptionly.com\/#organization","name":"Exceptionly","url":"https:\/\/exceptionly.com\/","logo":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/exceptionly.com\/#\/schema\/logo\/image\/","url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/05\/exceptionly-search-logo.png","contentUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/05\/exceptionly-search-logo.png","width":400,"height":400,"caption":"Exceptionly"},"image":{"@id":"https:\/\/exceptionly.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/exceptionly\/","https:\/\/x.com\/exceptionly","https:\/\/www.linkedin.com\/company\/exceptionly\/","https:\/\/www.youtube.com\/channel\/UCet5wATTyif6knI0h4vUkNA"]},{"@type":"Person","@id":"https:\/\/exceptionly.com\/#\/schema\/person\/a2600170dfb4513350affede916c0ccf","name":"Fatma Elverir","image":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","caption":"Fatma Elverir"},"sameAs":["https:\/\/exceptionly.com"],"url":"https:\/\/exceptionly.com\/ar\/author\/fatmaelverir\/"}]}},"_links":{"self":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts\/8472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/comments?post=8472"}],"version-history":[{"count":0,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts\/8472\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/media\/8501"}],"wp:attachment":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/media?parent=8472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/categories?post=8472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/tags?post=8472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}