Skip to main content

Posts

Showing posts from May, 2021

Launch multiple programs with one shortcut in Windows Operating System

  Yes...!! you heard is right 😊and it’s possible with simple coded steps. When we’re getting into a Daily work, we’ve to deal with many Tools, Editors, Folders and Files. Opening of all these on daily basis is a tedious job πŸ˜–. In My Scenario, daily I’ve to open multiple chrome browsers, project folders, files and visual studio to continue my regular project tasks. To mitigate this, I am bringing up this article for you Just by writing simple coded steps in a Notepad/any editor to overcome this. Write below code in notepad and click on File->Save As -> Give your name followed by .bat  extension and click on OK button. Now your shortcut key is ready. Just double click it and have fun with it. Below is the code: @echo off :: Open folders start %USERPROFILE%\Documents\ start %USERPROFILE%\Desktop\Test\ :: Open files start "" "%USERPROFILE%\Desktop\DeskTop\SM\test.txt" ::Open browser start chrome.exe start " " https://www.freecodecamp.org/learn...

Difference Between Programming and Coding

What exactly is the difference between programming and coding?  The other day, one of my friends who is not from a computer science background, asked me this question. Even after learning many different programming languages and doing several projects, I could not answer him correctly. I said both are the same. But why do we use two different terms, if both are the same? That led me to some research, and I thought I’d share what I found.   It’s not that complicated.  And their definitions allow for a lot of overlap. We often recognize the terms coding and programming as synonymous because both are often used interchangeably.   what is the difference between programming and coding? Coding is the act of expressing programmatic ideas in computer language. Programming is crafting ideas that can be executed repeatedly by a machine, not necessarily a computing device. While both the terms are synonymous with each other and are often used interchangeably, t...

Type Conversion

  Operations in our applications will commonly involve multiple data types. Because of that, we must deal with type conversions. Now there are implicit type conversions, and those are type conversions that are performed automatically by the compiler. To see a simple example of that, we look at something like here we have an integer iVal that we've assigned the value 50. If I then say long lVal equals iVal, the compiler must convert that 32 ‑ bit integer iVal into a 64 ‑ bit integer as it's stored into lVal. And there are also explicit type conversions, and these are conversions that I explicitly perform in my code and I do that using a cast operator. We see here if I had that long lVal = 50 now, so I'm now assigning a 64 ‑ bit integer the value of 50, if I want to assign that into this iVal, a 32 ‑ bit integer, I have to explicitly cast it. I must tell part of that I want to go from that 64 ‑ bit integer into a 32 ‑ bit integer. And I do that by using the type I want to con...

Operator Precedence

  The operators are evaluated in a well ‑ defined order. If we look at them, basically, the postfix operators are evaluated first, then prefix operators. Then the multiplicative operations, all right, multiplication, division, and modulus. And then finally, the additive operations, right, plus and minus. Operates of equal precedence are evaluated from the left side of the equation, moving right. And you can override precedents by using parentheses. If you have nested parentheses, those parentheses are evaluated from the inside out.   Demo: Operator Precedence

Arithmetic Operators

  Something we commonly must do in our programs is perform arithmetic operations. Java provides three basic categories of operators for performing math operations. They're the basic operators, like add, subtract, multiply, and divide, what are called prefix and postfix operators, and then what are called compound assignment operators. The basic math operators are just what you would expect, things like add, subtract, multiply, and divide. The operators we use for these are, again, things that are very familiar. If I'm adding, I use a plus sign. And when I do things like add, it doesn't really matter whether I'm using a floating point or an integer. So, if I say 1 + 2, the answer is going to be 3. For subtraction, we use the minus sign. Again, it doesn't really matter whether we're using floating point or integers. If I subtract 4 from 5, I get 1. If we multiply, we use an asterisk, 4 * 2 is 8. And all that stuff is straightforward. As we get to the divide operat...

Primitive Types are Stored By-value

  Java primitive types are stored by value, and that's important to understand because it affects the behaviour applications when we assign values from one variable to another. Let's look here. If I declare an initial variable called firstValue and I assign the value 100 to it, what's happening under the covers is that an area of memory is being allocated that's named firstValue and the value 100 is stored inside that memory. So now if I declare another variable, in this case, other value when I assign first value to it, again, I'm looking in an area of storage, I'm giving it a name otherValue, and when I make the assignment, the value 100 is being copied from firstValue into otherValue. And what that means is that there is a distinctly separate copy of that value 100 being moved over into otherValue. What that allows me to do then is that if I make modifications to firstValue, for example, assign the value 50 to it, that 50 replaces what's in firstValue, bu...