<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yash</title>
    <description>The latest articles on DEV Community by Yash (@yashranjit19).</description>
    <link>https://dev.to/yashranjit19</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2511083%2F75915b84-c26c-4b24-8fac-ad19d45677ea.jpg</url>
      <title>DEV Community: Yash</title>
      <link>https://dev.to/yashranjit19</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yashranjit19"/>
    <language>en</language>
    <item>
      <title>Computer Science and its wife Data</title>
      <dc:creator>Yash</dc:creator>
      <pubDate>Thu, 05 Dec 2024 07:25:18 +0000</pubDate>
      <link>https://dev.to/yashranjit19/computer-science-and-its-wife-data-3a48</link>
      <guid>https://dev.to/yashranjit19/computer-science-and-its-wife-data-3a48</guid>
      <description>&lt;p&gt;Wondering about the title? Yes, it’s true. Just like how a husband or boyfriend sticks around his wife or girlfriend, computers have always revolved around data. In this inseparable relationship, computer science is the enabler and data is the reason for existence. To prove this relationship, let me take you from the start.&lt;/p&gt;

&lt;h3&gt;
  
  
  Birth of Computers:
&lt;/h3&gt;

&lt;p&gt;Computers were invented for fast calculations. They handled the data for calculations with remarkable ease. When you handle something, you naturally begin to imagine new possibilities and push beyond existing limits. Recognizing the incredible speed of data handling, people began to contemplate storing data - much like couple preserving memories for their future. Eventually, the concepts of sharing and processing data emerged, expanding the computational landscape.&lt;/p&gt;

&lt;h5&gt;
  
  
  Key observations:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Initial Purpose: Fast Calculations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Capability: Efficient data handling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Insights of people: Potential beyond immediate use&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Evolution: From handling to storing to sharing and processing&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Now the mighty Algorithms:
&lt;/h3&gt;

&lt;p&gt;In the technical sense, algorithms are step by step procedures designed to solve a specific issue. Think of them like a crafted plan or strategy you might use to negotiate or clam down your partner when you want something to be done. Just like you tailor your approach, considering time and actions, algorithms are structured to handle tasks efficiently and accurately. In computer science, the ultimate goal of algorithms is to play with data - to process, sort, search, or manipulate it in ways that lead to meaningful results. Also talking about programming languages are tools that let us to write and interact with data, turning algorithms into executable actions.&lt;/p&gt;

&lt;h5&gt;
  
  
  Key observation:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;The essence of algorithms is they define how to perform data operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Abstraction : Making things look simpler
&lt;/h3&gt;

&lt;p&gt;Abstraction in computer science is like the secret language that couple uses to make complex things simpler or hide details from outsiders. Just like a couple might communicate in ways that only they understand - leaving unnecessary details for others.&lt;/p&gt;

&lt;p&gt;In CS, abstraction simplifies interactions with complex systems by focusing on the essential details and hiding the internal workings. For example, when you are working with high level programming language, you don’t need to worry about low level code. The abstraction layer handles it for you, letting you to focus on problem solving.&lt;/p&gt;

&lt;h5&gt;
  
  
  Key observation:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Simplifying complexity and hiding details when ever needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Operating System: The Resource Manager
&lt;/h3&gt;

&lt;p&gt;OS is like the household that manages the resources which ensures everything runs smoothly. Just like in the family managing wealth, relations with society, information with the outside world. OS engage in managing memory, processing tasks, or handling input/ output operations. It acts as intermediary between user and the hardware.&lt;/p&gt;

&lt;h5&gt;
  
  
  Key observation:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;The key thing to understand is that the OS manages resources that operate on data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Network: The highway for data
&lt;/h3&gt;

&lt;p&gt;When you plan for constructing a house, you may go to someone who’s an expert in the field, get details and make your plans accordingly - eventually construct your dream house. In the case of humans information is transferred through dialects, while computers do so through networks. Computers can access Internet with network allowances. Networks act as highways that enable data to travel from one point to another, whether it’s across room or across the globe.&lt;/p&gt;

&lt;h5&gt;
  
  
  Key observation:
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Networks enable data to travel from one point to another.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many subjects in computer science that revolve around data, both directly and indirectly. Some like data structures, databases and many other focus on data directly, while others, like operating systems and networks (and others like computer graphics - presents data, cybersecurity - protects data) handle data indirectly by managing resources and facilitating communication.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In conclusion, computer science is deeply intertwined with data. Just like a loving partner evolves through mutual care and understanding, data is constant partner that drives innovation and progress in field.&lt;/p&gt;

&lt;p&gt;This is my interpretation of CS, please forgive me for any errors.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Java for DSA Part 1</title>
      <dc:creator>Yash</dc:creator>
      <pubDate>Mon, 02 Dec 2024 14:09:10 +0000</pubDate>
      <link>https://dev.to/yashranjit19/java-for-dsa-part-1-2ld</link>
      <guid>https://dev.to/yashranjit19/java-for-dsa-part-1-2ld</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Java:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Java is general purpose and powerful language. It is fundamentally an object oriented programming language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Java is platform independent(portable), you write a program in your system and it can also run on other platform, you just have to take the byte code. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Java is strongly typed language, whereas python, javascript are not.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Java does automatic memory allocation. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are many other features, keeping in mind that we are preparing for DSA we would focus more on how to write code in java. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What do computers understand?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;computers understand 0s and 1s (binary code), writing programs in binary is tedious and error prone. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So we came up with high level programming languages(c,c++,java,python), which are more closer to the developer, binary code is closer to machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For running programs written in high level language we have transform them into machine code. For this we have tools like compilers, Interpreters and assemblers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How does Java code run?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Before that we have talk about JDK (Java Development Kit), which helps us write and run java Programs. It has different tools and libraries like JRE, JVM etc&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JRE is java runtime environment (provide environment to run) which consists JVM (Java virtual Machine- Executes bytecode), this thing makes java platform independent and special. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fje0en6q9ml95kioirix5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fje0en6q9ml95kioirix5.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now how does it run: will illustrate using the picture: &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzvy61irbpncujx920ir5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzvy61irbpncujx920ir5.png" alt="Image description" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source code goes through the compiler and we get a .class file which is bytecode. And to execute this JVM produces native code(which is specific to machine/platform).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~java FileName.java&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Syntax:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Main
{
   public static void main(String args[])
   {

   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Variables:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Variables are names for memory locations, where we store data. Using variables we can access, retrieve, and modify stored data.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dataType variableName = value; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or &lt;br&gt;
you can declare variable and assign value afterwards.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dataType variableName;
variableName = value;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Data Types:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Data types can be divided into two types: Primitive and non primitive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Primitive types are: byte, short, char, boolean, int, long, float, double&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Non primitive: String, class, Array, object, Interface&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Size of data types:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;1 byte is equal to 8 bits, a bit can have one of either states 0 or 1&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;byte - 1 byte (-128 to 127)&lt;/li&gt;
&lt;li&gt;short - 2 bytes&lt;/li&gt;
&lt;li&gt;char - 2 bytes&lt;/li&gt;
&lt;li&gt;boolean - 1 byte (true or false)&lt;/li&gt;
&lt;li&gt;int - 4 bytes&lt;/li&gt;
&lt;li&gt;long - 8 bytes&lt;/li&gt;
&lt;li&gt;float - 4 bytes&lt;/li&gt;
&lt;li&gt;double - 8 bytes&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Output:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Output in java to the console can be done with the following functions.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.out.println("Hello there!");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.out.print("Hello there!");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;println() -&amp;gt; goes to a new line &lt;br&gt;
print() -&amp;gt; does not go to a new line&lt;br&gt;
\n - can also be used for printing a new line&lt;/p&gt;
&lt;h2&gt;
  
  
  Input in Java:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To take input in java we have different methods, here we will talk about Scanner class. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 1: We have to import Scanner class (this should be done at the top of the program)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.Scanner;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.*;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;imports all the utility package. &lt;/p&gt;

&lt;p&gt;Step 2: Now we have to create instance/ object of Scanner class&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scanner in = new Scanner(System.in);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We have to note something, there are different functions for different data types through which we can take input.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;next() - this is for &lt;strong&gt;string&lt;/strong&gt; and it only (captures) takes input till the first space.&lt;/li&gt;
&lt;li&gt;nextLine() - this is for &lt;strong&gt;string&lt;/strong&gt; and it take (captures) complete line&lt;/li&gt;
&lt;li&gt;nextInt() - this is for &lt;strong&gt;int&lt;/strong&gt; data type.&lt;/li&gt;
&lt;li&gt;nextFloat() - this is for &lt;strong&gt;float&lt;/strong&gt; data type.&lt;/li&gt;
&lt;li&gt;nextBoolean() - this is for &lt;strong&gt;boolean&lt;/strong&gt; values.&lt;/li&gt;
&lt;li&gt;nextDouble() - this is for &lt;strong&gt;double&lt;/strong&gt; values&lt;/li&gt;
&lt;li&gt;nextLong() - this is for &lt;strong&gt;long&lt;/strong&gt; values. &lt;/li&gt;
&lt;li&gt;nextByte() - this is for &lt;strong&gt;byte&lt;/strong&gt; values. &lt;/li&gt;
&lt;li&gt;nextShort() - this is for &lt;strong&gt;short&lt;/strong&gt; values. &lt;/li&gt;
&lt;li&gt;next.charAt(0) - this is for &lt;strong&gt;char&lt;/strong&gt; values, 0 inside () tells about the place, 0 is the starting point of the text. &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Type Conversion:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Type conversion, by that I mean a data type converting to another data type happens in two cases:

&lt;ol&gt;
&lt;li&gt;When type is compatible 
eg: int &amp;lt;--&amp;gt; float (but float value changing into int will cause truncation of decimal values)&lt;/li&gt;
&lt;li&gt;When destination type is bigger than source type (destination type &amp;gt; source type)
byte -&amp;gt; short -&amp;gt; int -&amp;gt; float -&amp;gt; long -&amp;gt; double&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Type Casting:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;By type casting, I mean explicitly converting a dataType.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;float val = 23.456f;
int num = (int)val;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Operators:
&lt;/h2&gt;

&lt;p&gt;-Operators are the symbols that tell the compiler to perform some operation. &lt;/p&gt;

&lt;h3&gt;
  
  
  Type of operators:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Arithmetic operators (binary, unary and ternary)&lt;/li&gt;
&lt;li&gt;Relational operators&lt;/li&gt;
&lt;li&gt;Logical operators&lt;/li&gt;
&lt;li&gt;Bitwise operators (Bit manipulation)&lt;/li&gt;
&lt;li&gt;Assignment operators&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Arithmetic Operators:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;These are used to perform arithmetic operations. &lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Binary:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+ : used for addition 
- : used for subtraction
* : used for multiplication
/ : used for division
% : used to get remainder (modulo)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Unary:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;++ : Increment by 1 (a = a+1)
-- : decrement by 1 (a = a-1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;There are two types in each unary operators: 
1.Pre increment (++a)
-&amp;gt; First Changes the value and second uses the value 
2.Post increment (a++)
-&amp;gt; First uses the value and second changes the value
Same for decrement also. 
Pre decrement (--a) and post decrement(a--)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Relational Operators:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;== : Checks equality
!= : Not equal to (check inequality)
&amp;gt;  : Greater than
&amp;lt;  : Less than
&amp;gt;= : greater than equal to
&amp;lt;= : Less than equal to
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Logical Operators:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;amp;&amp;amp; : logical AND
|| : logical OR
!  : logical Not (Negation)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Assignment Operators:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;= : assigns value of right side operand to left operand 
+= : a = a+b -&amp;gt; a+=b
-= : a = a-b -&amp;gt; a-=b
*= : a = a*b -&amp;gt; a*=b
/= : a = a/b -&amp;gt; a/=b
%= : a = a%b -&amp;gt; a%=b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conditional Statements:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Conditional statements get executed when the condition give is true. The conditional statements are: &lt;/li&gt;
&lt;li&gt;if, else&lt;/li&gt;
&lt;li&gt;else if&lt;/li&gt;
&lt;li&gt;ternary operator &lt;/li&gt;
&lt;li&gt;switch
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax of if else: 
if(condition){
   // code goes here --&amp;gt; this code runs when the condition is true
} else{
// code --&amp;gt; this code runs when the condition is false
}

eg: 
int age = 19
if (age&amp;gt;18){
 System.out.println("U are good to drive");
//this code runs because condition is true
}else{
System.out.println("U should not drive now");
//this code does not run because condition is not false
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax of else if:
if (condition1){
//code
}else if(condition2){
//code
}else{
//code}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax for ternary operator: 
variable = condition ? statement1: statement2;

eg: 
boolean largeNum = (145&amp;gt;89) ? true:false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax of switch: 
switch(variable){
case 1: //code
       break;
case 2: //code
       break;
default : //code
         break;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Loops:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Loops are used for repetitive tasks. The loops are: 

&lt;ol&gt;
&lt;li&gt;while&lt;/li&gt;
&lt;li&gt;for&lt;/li&gt;
&lt;li&gt;do while
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax of while loop: 

initialisation;
while(condition){
//code
updation; //used to avoid looping infinite times
}

eg: 
//print 1 to 10
int count = 1;
while(count&amp;lt;=10){
System.out.println(count);
count++;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Syntax of For: 

for(initialisation; condition; updation){
//code
}

eg: 
//print 1 to 10

for(int i =1; i&amp;lt;=10; i++){
System.out.println(i);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only way to learn a language is to code it. &lt;br&gt;
This is my first blog, please forgive me for any errors.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>programming</category>
      <category>java</category>
    </item>
  </channel>
</rss>
