Skip to main content

Posts

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...
Recent posts

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...

Primitive Data Types

  So, as we've seen when we declare our variables, we give them a type, and the most fundamental types in Java are what are called primitive data types, and these are the data types that are built into the language. Now, when you hear the term primitive data type, you may think there's something kind of lowly about them, you know, something kind of, you know, less than modern about them. But that's not true at all. Primitive data types are actually very important. They're really the foundation of all other types that we use in Java, so they're really that kind of strong foundation that we're going to build on for any other data types we use in our programs. Now there are four categories of primitive types in Java. There are the integer types, floating point, character, and Boolean. So, let's look first at the integer types. Now there are four different integer types, but the difference then really is just the size of storage that they take up. But that diffe...

Variables, Data Types and Math Operations

  In order to do anything interesting in a program, we must have the ability to store and manipulate values. What allows us to do that are what we call variables. Now a variable, simply put, is just named data storage. Now Java is a strongly ‑ typed language. Now what that means is that when we declare a variable like, in this case, we have a variable named data Value, we have to specify the type of that variable, in this case, it's what we call an int, something that can store integers. So, what that means is that the data Value variable can only store things that are compatible with the type int. As we go through the course, we'll talk about this idea of one type being compatible with another. Now when we declare a variable, we can, of course, then assign a value to it, so our variable data Value now holds the value 100. Now when we use variables, we can do it the way we've done here where we declare it, then assign it, or as a matter of convenience, we can declare them a...

Introduction to Packages

Let's talk briefly about Java packages. Now packages are a very important concept in Java, and we can talk a great deal more about them later. We have a whole module dedicated to them. I want to look at just a couple of simple things about packages right now to get us started. Now, if we look at our source code, all the source code we've written up until now has just kind of our class definitions, and that's kind of by itself. But if you look at most Java source code out there, you'll see that at the top of the source code files is the word package, followed by some name, and what this does when we add this package concept is it provides organization within a Java program. Now, again, there're a lot of aspects of that, but I want to look at just kind of two basic aspects of it to get us started. One is that these package names follow a standard naming convention, and they affect our source code file structure. Now in terms of the naming convention, one very simple r...

Comments

  Java, like most programming languages, can include comments. All right, and comments are just basically text inside of your source code that the compiler doesn't see. Right, and there are really kind of just two general uses for comments. One is that it allows you to add human readable notes to your source code, right, it allows you to type things in the source code so that when you look at it later, or someone else looks at it, it's just leaving notes to understand what you were doing there. It's also useful for hiding source cool without deleting it. Maybe you're testing things out, so you want to just kind of take some things away and type some new stuff, or if there's something you don't want to anymore, but you think you want to do it again in the future, so comments allow you to take that stuff out so the content is in your source code, but the compiler doesn't compile it. There are three types of comments in Java. One, which is called line comments,...