{"id":23893594,"url":"https://github.com/devlopersabbir/java-all-about","last_synced_at":"2025-02-23T06:15:23.648Z","repository":{"id":192346324,"uuid":"683932024","full_name":"devlopersabbir/java-all-about","owner":"devlopersabbir","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-19T16:29:32.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-04T14:28:05.496Z","etag":null,"topics":["java","java-advanced","java-basics"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devlopersabbir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-28T05:01:19.000Z","updated_at":"2023-09-03T06:09:50.000Z","dependencies_parsed_at":"2025-01-04T14:38:18.057Z","dependency_job_id":null,"html_url":"https://github.com/devlopersabbir/java-all-about","commit_stats":null,"previous_names":["devlopersabbir/java-all-about"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlopersabbir%2Fjava-all-about","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlopersabbir%2Fjava-all-about/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlopersabbir%2Fjava-all-about/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devlopersabbir%2Fjava-all-about/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devlopersabbir","download_url":"https://codeload.github.com/devlopersabbir/java-all-about/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240275924,"owners_count":19775615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-advanced","java-basics"],"created_at":"2025-01-04T14:28:02.721Z","updated_at":"2025-02-23T06:15:23.602Z","avatar_url":"https://github.com/devlopersabbir.png","language":"Java","readme":"# Java All About\n\nList of the Java class\n\n## 01. Hello World Program [Hello](./Hello.java)\n\n- Code example\n\n  ```java\n  public class Hello {\n  public static void main(String[] arg) {\n      System.out.println(\"Hello World\");\n      }\n  }\n  ```\n\n## 02. Comments in Java [Comments](./Comments.java)\n\n- Code example\n\n  ```java\n  public class Comments {\n  // To returning my name\n  public static String name() {\n          return \"Sabbir Hossain\"; // it's return name as string\n      }\n\n  /*\n  * For showing my name\n  */\n  public static void main(String[] arg) {\n          System.out.println(name());\n      }\n  }\n  ```\n\n## 03. Variable in Java [Variable](./Variable.java)\n\nThe variable syntax looks like this.\n\n```console\ntype variableName = value;\n```\n\n\u003e Types of varibale\n\n- The first is a type: type is means which kind of data you want to store, on\n  this varibale. based on your went to stored value, you have to call a type\n  like\n\n  1. **String** - stores text, such as \"Hello\". String values are surrounded by\n     double quotes or single quote.\n  2. **int** - stores integers (whole numbers), `111, -111`\n  3. **float** - stores number with decimals like: `11.34, -55.10`\n  4. **char** - Single characters like: `a or \"A\"`\n  5. **boolean** - Store true or false value only\n\n  ### Code example\n\n  ```java\n  public class Variable {\n    public static void main(String[] arg) {\n        /*\n         * Variable in java\n         */\n        String friendName = \"Rafiul\"; // this is varibale to store friend name\n        System.out.println(friendName);\n\n        final int myNumber = 20;\n        System.out.println(myNumber);\n\n        // perform mathmetical task\n        int fNumber = 20;\n        int lNumber = 10;\n        // make a varibale for storing result inside the result variable\n        int result = fNumber + lNumber; // answer should be 30\n        System.out.println(result);\n    }\n  }\n  ```\n\n## 04 Data type [data-type](./data-types)\n\nJava data type\n\n### 04.1 Number Data Type [Number](./data-types/NumberType.java)\n\n## 05 Defarent between primitive \u0026 Non-Primitive\n\n| Primitive                                                                     | Non-Primitive                                                                                    |\n| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |\n| Primitive types are predefined (already defined) in Java                      | Non-primitive types are created by the programmer and is not defined by Java (except for String) |\n| Non-primitive types can be used to call methods to perform certain operations | while primitive types cannot                                                                     |\n| A primitive type has always a value                                           | while non-primitive types can be null                                                            |\n| A primitive type starts with a lowercase letter                               | while non-primitive types starts with an uppercase letter                                        |\n\n## 05. [Java String](./String/JavaString.java)\n\nStrings are used for storing text.\n\n- 05.1 String Length\n\n  A `String` in Java is actually an object. which contain methods that can\n  perform certain operations on strings. For example, the length of a string can\n  be found with the `length()` method:\n\n  ```java\n\n  String txt = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n  System.out.println(\"The length of the txt string is: \" + txt.length());\n  ```\n\n- 05.2 More String Methods There are many string methods available, for example\n  `toUpperCase()` and `toLowerCase()`:\n  ```java\n  String txt = \"Hello World\";\n  System.out.println(txt.toUpperCase());   // Outputs \"HELLO WORLD\"\n  System.out.println(txt.toLowerCase());   // Outputs \"hello world\"\n  ```\n- 05.3 Finding a Character in a String The `indexOf()` method returns the index\n  (the position) of the first occurrence of a specified text in a string\n  (including whitespace):\n\n  ```java\n  String txt = \"Please locate where 'locate' occurs!\";\n  System.out.println(txt.indexOf(\"locate\")); // Outputs 7\n  ```\n\n## 36. [Java Method](./oop-ep-33/java-method/JavaMethod.java)\n\nJava method work as like same as normal method that can help us to perform any\nkind of task\n\n#### Deffrent between public \u0026 Static Keyword\n\n- Public\n  - Public methods must be called by creating objects\n- Static\n  - Static methods can be called without creating objects\n\n## [Java Polymorphism](./oop-ep-33/java-polymorphism/JavaPolymorphism.java)\n\nThe word polymorphism means having many forms. In simple words, we can define\npolymorphism as the ability of a message to be displayed in more than one form.\n\nReal-life Illustration Polymorphism: A person at the same time can have\ndifferent characteristics. Like a man at the same time is a father, a husband,\nand an employee. So the same person possesses different behavior in different\nsituations. This is called polymorphism.\n\n#### What is Polymorphism in Java?\n\nPolymorphism is considered one of the important features of Object-Oriented\nProgramming. Polymorphism allows us to perform a single action in different\nways. In other words, polymorphism allows you to define one interface and have\nmultiple implementations. The word “poly” means many and “morphs” means forms,\nSo it means many forms.\n\n#### Types of Java polymorphism\n\nIn Java polymorphism is mainly divided into two types:\n\n- Compile-time Polymorphism\n\n  ##### Compile-Time Polymorphism\n\n  It is also known as static polymorphism. This type of polymorphism is achieved\n  by function overloading or operator overloading.\n\n  \u003e Note: But Java doesn’t support the Operator Overloading. **Function\n  \u003e Overloading**\n\n  ```java\n  class JavaPolymorphism {\n    public static void main(String[] args) {\n        System.out.println(Helper.multiply(2, 3));\n        System.out.println(Helper.multiply(2.3, 3.8));\n    }\n  }\n\n  class Helper {\n      static int multiply(int a, int b) { // we reveive 2 number a and b which is integer types\n          return a * b;\n      }\n\n      static double multiply(double a, double b) {\n          return a * b;\n      }\n  }\n\n  ```\n\n  **Output**\n\n  ```\n  6\n  1.1399999999999992\n  ```\n\n- Runtime Polymorphism\n\n\njava basic\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlopersabbir%2Fjava-all-about","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlopersabbir%2Fjava-all-about","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlopersabbir%2Fjava-all-about/lists"}