From efb43fe449b7efc7130340c95d1e571ac25ef19c Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 10:58:04 +0530 Subject: [PATCH 01/11] Update java.md --- java.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/java.md b/java.md index f457412..c59e5c1 100644 --- a/java.md +++ b/java.md @@ -44,14 +44,14 @@ Java is a very popular general-purpose programming language, it is class-based a ## Variables ```java -short x = 999; // -32768 to 32767 -int x = 99999; // -2147483648 to 2147483647 -long x = 99999999999L; // -9223372036854775808 to 9223372036854775807 +short x = 999; // -32768 to 32767 +int x = 99999; // -2147483648 to 2147483647 +long x = 99999999999L; // -9223372036854775808 to 9223372036854775807 float x = 1.2; double x = 99.99d; -byte x = 99; // -128 to 127 +byte x = 99; // -128 to 127 char x = 'A'; boolean x = true; ``` @@ -134,9 +134,9 @@ Class is the blueprint of an object, which is also referred as user-defined data ```java class Mobile { - public: // access specifier which specifies that accessibility of class members - string name; // string variable (attribute) - int price; // int variable (attribute) + public: // access specifier which specifies that accessibility of class members + string name; // string variable (attribute) + int price; // int variable (attribute) }; ``` ### How to create a Object: From 553bf7a0b5cb2eeeb45f059b073d73eeb9992d02 Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:10:43 +0530 Subject: [PATCH 02/11] Update php.md --- php.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/php.md b/php.md index b988f04..39111da 100644 --- a/php.md +++ b/php.md @@ -82,15 +82,15 @@ Switch is used to execute one set of statement from multiple conditions. ```php switch(conditional-expression) { case value1: - // code if the above value is matched - break; // optional + // code if the above value is matched + break; // optional case value2: - // code if the above value is matched + // code if the above value is matched break; // optional ... default: - // code to be executed when all the above cases are not matched; + // code to be executed when all the above cases are not matched; } ``` @@ -106,7 +106,7 @@ for(Initialization; Condition; Increment/decrement){ ``` #### For-each: ```php -// you can use any of the below syntax + // you can use any of the below syntax foreach ($array as $element-value) { //code } From afefa212e92a7c3a7b1614b98fadb90af8de8e1e Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:20:07 +0530 Subject: [PATCH 03/11] Update javascript.md --- javascript.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript.md b/javascript.md index 79e6b13..66ef860 100644 --- a/javascript.md +++ b/javascript.md @@ -132,12 +132,12 @@ const users = [ ``` ## Functions ```javascript -function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo +function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo console.log(`Hello ${name}!`); } -greet() // Hello Foo -greet({ name: 'Bar' }) // Hi Bar +greet() // Hello Foo +greet({ name: 'Bar' }) // Hi Bar ``` ## Loops ### 1. If: From 5fedf7680c8453c9203f398e0d0c0cb29d47ea9b Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:23:22 +0530 Subject: [PATCH 04/11] Update go.md --- go.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.md b/go.md index f045c81..90cd80c 100644 --- a/go.md +++ b/go.md @@ -104,10 +104,10 @@ Switch is an alternative to If-Else-If ladder. ```go switch conditional-expression { case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ... From 3145fd890f30ca186e74235b8f1bbe1ff1e544d3 Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:26:23 +0530 Subject: [PATCH 05/11] Update vb.md --- vb.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vb.md b/vb.md index 1c97f48..4941744 100644 --- a/vb.md +++ b/vb.md @@ -10,7 +10,7 @@ OneCompiler's VB.net online editor supports stdin and users can give inputs to p Public Module Program Public Sub Main(args() As string) Dim name as String = Console.ReadLine() ' Reading input from STDIN - Console.WriteLine("Hello " & name) ' Writing output to STDOUT + Console.WriteLine("Hello " & name) ' Writing output to STDOUT End Sub End Module ``` @@ -57,7 +57,7 @@ End If If(conditional-expression)Then 'code if the conditional-expression is true Else - 'code if the conditional-expression is false + 'code if the conditional-expression is false End If ``` @@ -65,7 +65,7 @@ End If ```vb If(conditional-expression)Then - 'code if the above conditional-expression is true + 'code if the above conditional-expression is true Else If(conditional-expression) Then 'code if the above conditional-expression is true Else @@ -77,7 +77,7 @@ End If ```vb If(conditional-expression)Then - 'code if the above conditional-expression is true + 'code if the above conditional-expression is true If(conditional-expression)Then 'code if the above conditional-expression is true End If From 2bb70bd645fb19a19f1a87b817dd23f5e985de9f Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:29:09 +0530 Subject: [PATCH 06/11] Update typescript.md --- typescript.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript.md b/typescript.md index 6de924a..0463216 100644 --- a/typescript.md +++ b/typescript.md @@ -92,7 +92,7 @@ for(Initialization; Condition; Increment/decrement){ let arr = [1, 2, 3, 4, 5]; for (let ele of arr) { - // code +// code } for (let index in arr) { @@ -149,5 +149,5 @@ function Addition(a: any, b:any): any { return a + b; } Addition("Hello ","foo"); // outputs Hello foo -Addition(2,3); //outpus 5 -``` \ No newline at end of file +Addition(2,3); //outpus 5 +``` From 2d3829eb9d0191320da298c54af8c25e5db253cc Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:32:27 +0530 Subject: [PATCH 07/11] Update c.md --- c.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/c.md b/c.md index fc74a1b..2a4eae7 100644 --- a/c.md +++ b/c.md @@ -55,15 +55,15 @@ Switch is an alternative to if-else-if ladder. ```c switch(conditional-expression) { case value1: - // code - break; // optional + // code + break; // optional case value2: - // code - break; // optional + // code + break; // optional ... default: - // code to be executed when all the above cases are not matched; + // code to be executed when all the above cases are not matched; } ``` ### 3. For: From 7effd7a1a9c8ef5099eaff56a0cb275e6e8ff306 Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:34:29 +0530 Subject: [PATCH 08/11] Update groovy.md --- groovy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/groovy.md b/groovy.md index 6ec031d..b0fd724 100644 --- a/groovy.md +++ b/groovy.md @@ -81,15 +81,15 @@ Switch is an alternative to If-Else-If ladder and to select one among many block ```java switch(conditional-expression) { case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ... default: - //code to be executed when all the above cases are not matched; + //code to be executed when all the above cases are not matched; } ``` From 56c7bbfa610879c46def3651e103e12cf32c6a92 Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:39:00 +0530 Subject: [PATCH 09/11] Update csharp.md --- csharp.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csharp.md b/csharp.md index 6e22b51..4734418 100644 --- a/csharp.md +++ b/csharp.md @@ -71,15 +71,15 @@ Switch is an alternative to If-Else-If ladder. ```c# switch(conditional-expression) { case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ... default: - // code to be executed when all the above cases are not matched; + // code to be executed when all the above cases are not matched; } ``` ### 3. For: From e1a7cd269dc54d0529bdb9a640794d7dfbbc400c Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:43:22 +0530 Subject: [PATCH 10/11] Update cpp.md --- cpp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp.md b/cpp.md index 0ea1416..aa8e79b 100644 --- a/cpp.md +++ b/cpp.md @@ -55,10 +55,10 @@ Switch is an alternative to If-Else-If ladder. ```c switch(conditional-expression){ case value1: - // code + // code break; // optional case value2: - // code + // code break; // optional ...... From 0258088e55ee3ee3949381db22c2ebbf8e48ef09 Mon Sep 17 00:00:00 2001 From: Mourya3006 Date: Thu, 6 Feb 2025 11:49:11 +0530 Subject: [PATCH 11/11] Update perl.md --- perl.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl.md b/perl.md index 9646a53..3931bf8 100644 --- a/perl.md +++ b/perl.md @@ -40,8 +40,8 @@ There is no need to specify the type of the data in Perl as it is loosely typed In Perl, there is no need to explicitly declare variables to reserve memory space. When you assign a value to a variable, declaration happens automatically. ```perl -$var-name =value; #scalar-variable -@arr-name = (values); #Array-variables +$var-name =value; #scalar-variable +@arr-name = (values); #Array-variables %hashes = (key-value pairs); # Hash-variables ``` ## Loops