diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/100-basic-syntax.md b/content/roadmaps/110-java/content/100-java-fundamentals/100-basic-syntax.md index dfece63bd..6f1266971 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/100-basic-syntax.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/100-basic-syntax.md @@ -2,6 +2,9 @@ Understanding the basics is the key to a solid foundation. In this section, learn the basic terminologies, naming conventions, reserved words, conditions, functions, data structures, OOP, packages, etc. +* To print output use --> System.out.println(); +* To take input from user --> Scanner or BufferedReader class can be used + Free Content Basic Java Syntax Java - Basic Syntax diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/101-data-types-variables.md b/content/roadmaps/110-java/content/100-java-fundamentals/101-data-types-variables.md index e749dc845..cfedca358 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/101-data-types-variables.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/101-data-types-variables.md @@ -2,6 +2,10 @@ Variable in Java is a data container that stores the data values during Java program execution. Every variable is assigned a data type, which designates the type and quantity of values it can hold. Variable is a memory location name of the data. The Java variables have mainly three types: Local, Instance and Static. +Data Types are divided into two group - +* Primitive - byte,short,int,long,float,double,boolean and char +* Non-Primitive - String, Arrays and Classes + Free Content What are Data Types & Variables? Java Variables diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/102-conditionals.md b/content/roadmaps/110-java/content/100-java-fundamentals/102-conditionals.md index ca177d125..66b1e0dc4 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/102-conditionals.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/102-conditionals.md @@ -6,6 +6,7 @@ Java has the following conditional statements: * Use `else` to specify a block of code to be executed if the same condition is false * Use `else if` to specify a new condition to test; if the first condition is false * Use `switch` to specify many alternative blocks of code to be executed +* Use `?,:` operator to specify one line condition Free Content What are Conditional statements? diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/103-functions.md b/content/roadmaps/110-java/content/100-java-fundamentals/103-functions.md index 332b3cae3..2afaed3b0 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/103-functions.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/103-functions.md @@ -2,6 +2,10 @@ A method/function is a way to perform some task. Similarly, in programming like Java, a function method is a block of code written to perform a specific task repeatedly. It provides reusability of code. We write the function once and use it many times. It works on the 'DRY' principle i.e., "Do not repeat yourself". +Steps - +1. Define function - datatype function_name(parameters){body} +2. Call function - function_name(values) + Free Content Methods/Functions in Java. diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/104-datastructures.md b/content/roadmaps/110-java/content/100-java-fundamentals/104-datastructures.md index 1c1207dc8..496289bef 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/104-datastructures.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/104-datastructures.md @@ -2,6 +2,11 @@ As the name indicates itself, a **Data Structure** is a way of organizing the data in the **memory** so that it can be used efficiently. Some common data structures are array, linked list, stack, hashtable, queue, tree, heap, and graph. +* Array allocates continuous memory for homogeneous data +* Linked List stores data in nodes with references +* Stack follows Last In First Out principle +* Queue follows First In First Out principle + Free Content What are Data Structures? Data Structures and Algorithms diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/106-files-and-apis.md b/content/roadmaps/110-java/content/100-java-fundamentals/106-files-and-apis.md index f123c56d6..3cb16f0db 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/106-files-and-apis.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/106-files-and-apis.md @@ -2,6 +2,9 @@ Learn how to work with files i.e., reading, writing and deleting, files and folders, etc. Also, learn how to make API calls, parse the incoming response, and so on. +* FileWriter - this class is useful to create a file by writing characters into it +* FileReader - this class is useful to read data in form of characters from file + Free Content How To Work With Files In Java Java File Class diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/106-packages.md b/content/roadmaps/110-java/content/100-java-fundamentals/106-packages.md index b324155be..5fd977daf 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/106-packages.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/106-packages.md @@ -2,6 +2,8 @@ A package is a namespace that mainly contains classes and interfaces. For instance, the standard class `ArrayList` is in the package `java.util`. For this class, `java.util.ArrayList` is called its fully qualified name because this syntax has no ambiguity. Classes in different packages can have the same name. For example, you have the two classes `java.util.Date` and `java.sql.Date`, which are different. If no package is declared in a class, its package is the default package. +To create package use this command -> javac -d directory javafilename + Free Content Packages in Java Java Package diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/107-loops.md b/content/roadmaps/110-java/content/100-java-fundamentals/107-loops.md index d3718e404..f262f3936 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/107-loops.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/107-loops.md @@ -1,6 +1,10 @@ # Loops -In Java and other programming languages, loops are used to iterate a part of the program several times. There are three types of loops in Java, `for`, `while`, and `do...while`. +In Java and other programming languages, loops are used to iterate a part of the program several times. There are four types of loops in Java, `for`, `forEach`, `while`, and `do...while`. + +* Synatx of `for` loop is `for(initialization;condition;increment/decrement){}` +* Syntax of `forEach` loop is `for(data_type variable:array_name){}` + Free Content What are loops in Java? diff --git a/content/roadmaps/110-java/content/100-java-fundamentals/108-exception-handling.md b/content/roadmaps/110-java/content/100-java-fundamentals/108-exception-handling.md index b79a9e2df..2ea015775 100644 --- a/content/roadmaps/110-java/content/100-java-fundamentals/108-exception-handling.md +++ b/content/roadmaps/110-java/content/100-java-fundamentals/108-exception-handling.md @@ -2,6 +2,11 @@ Exception Handling in Java is one of the effective means to handle the runtime errors so that the regular flow of the application can be preserved. Java Exception Handling is a mechanism to handle runtime errors such as ClassNotFoundException, IOException, SQLException, RemoteException, etc. +There are three types of exceptions - +1. Checked Exception - exceptions checked at compile time. Example - IOException +2. Unchecked Exception - exceptions checked at run time. Example - NullPointerException +3. Error - It is irrecoverable. Example - OutOfMemoryError + Free Content Exception Handling - G4G Understanding Java Exceptions