{"id":19229,"date":"2020-11-17T23:15:23","date_gmt":"2020-11-17T17:45:23","guid":{"rendered":"https:\/\/internshala.com\/blog\/?p=19229"},"modified":"2020-11-30T08:49:53","modified_gmt":"2020-11-30T03:19:53","slug":"getting-started-with-java-basics-of-java","status":"publish","type":"post","link":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/","title":{"rendered":"Getting started with Java: Basics of Java"},"content":{"rendered":"<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19231 aligncenter\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Introduction-to-Java.jpg\" alt=\"Getting started with Java\" width=\"595\" height=\"372\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This year, Java turned 25. If you have ever felt grateful for LinkedIn, Twitter, or Facebook, then it\u2019s not too late to send in your wishes to Java! Although there are many new kids on the block (Python snickers in the background), Java continues to occupy an important place in the hearts and code of 8 million developers worldwide. If you want to get acquainted with Java too, then read on!<\/span><\/p>\n<p style=\"text-align: justify;\"><b>1. Java\u2019s programming environment<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">JDK, JRE, and JVM are three components that make up Java\u2019s programming environment.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>I) Java Development Kit (JDK)<\/b><span style=\"font-weight: 400;\"> &#8211; It is a software package that is used to create Java applications. It converts code written by you i.e. source code into bytecode. This is done with the help of a debugger, which removes the errors, and a compiler. The java compiler, <\/span><i><span style=\"font-weight: 400;\">javac<\/span><\/i><span style=\"font-weight: 400;\"> converts a .java file into a .class file which is executed by JVM.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">For example, if we write an application called HelloJavaApp, we need to save it with the .java extension. When we compile this class, it gets converted into a HelloJavaApp.class.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19243\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Java-compiler.png\" alt=\"\" width=\"602\" height=\"74\" \/><\/p>\n<p style=\"text-align: justify;\"><b>II) Java Runtime Environment (JRE) <\/b><span style=\"font-weight: 400;\">&#8211; It is a software that is a part of JDK and is used to run Java programs. It does so through various development tools, libraries, and JVM. With the help of Java Virtual Machine (JVM), you can run your Java code on any operating system, which makes Java a platform-independent language.\u00a0\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">\u2018Write once, run anywhere\u2019 is Java\u2019s stellar feature and every app developer\u2019s dream come true! <\/span><\/p>\n<p style=\"text-align: justify;\"><b>2. Java terminology<\/b><\/p>\n<p style=\"text-align: justify;\"><b>I) Objects &#8211; <\/b><span style=\"font-weight: 400;\">Java is an object-oriented programming language, so everything revolves around classes and objects. An object in Java is similar to a real-world entity. For example, it can be a \u2018person\u2019 with attributes like name, age, and weight, which can be stored in Java through variables. This \u2018person\u2019 performs some functions like eating, working, playing, etc., which are called methods in Java. These variables and methods make up an object in Java.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>II) Classes <\/b><span style=\"font-weight: 400;\">&#8211; A class is like a blueprint that you use to create objects of similar types. For example, you can have a class House, which can have rooms as objects. Although each room will share similar properties, it will also vary slightly.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A class consists of variables, methods, and constructors. Every Java application begins with a class, which can be created using the <\/span><i><span style=\"font-weight: 400;\">class <\/span><\/i><span style=\"font-weight: 400;\">keyword. For example, class Internship. If you want to create an object of this class, you can use the keyword <\/span><i><span style=\"font-weight: 400;\">new<\/span><\/i><span style=\"font-weight: 400;\"> to declare it.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Internship intern = new Internship (\u201cShalini\u201d, 20);<\/span><\/p>\n<p style=\"text-align: justify;\"><b>III) Methods<\/b><span style=\"font-weight: 400;\"> &#8211; A method is a set of statements that is used to perform a certain task in Java. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">class HelloJava\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">public static void main (String args[] )<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">System.out.print (\u201cHello, Java\u201d);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This program prints Hello, Java. The main() method is used by JVM as a starting point to run this program, and the print() method is used to print the output.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>IV) Data types <\/b><span style=\"font-weight: 400;\">&#8211;<\/span> <span style=\"font-weight: 400;\">You can store different types of data in Java using various data types, which have been divided into two categories &#8211; primitive and non-primitive.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Primitive data types occupy a specific size which has been predefined in Java. They are of 8 types &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>i. byte<\/b><span style=\"font-weight: 400;\"> &#8211;\u00a0 It is used to store whole numbers from -128 to 127. Staying true to its name, it takes up 1 byte of space! For example &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">byte myAge = 21;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>ii. short<\/b><span style=\"font-weight: 400;\"> &#8211; It is used to store whole numbers from -32,768 to 32,767. It uses 2 bytes of memory. For example &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">short myStipend = 20000;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii. int<\/b><span style=\"font-weight: 400;\"> &#8211; It is used to store integers from\u00a0 -2^31 to 2^31-1 (around 2 billion). It allocates 4 bytes of memory. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int lotteryPrize = 1000000001;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">You can use underscore to improve the readability of your code.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int lotteryPrize = 100_000_0001;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iv. long<\/b><span style=\"font-weight: 400;\"> &#8211; It is used to store whole numbers from <\/span><span style=\"font-weight: 400;\">-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807<\/span><i><span style=\"font-weight: 400;\">. <\/span><\/i><span style=\"font-weight: 400;\">It takes 8 bytes of memory. For example &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">long accountNumber = 39504567921L;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Note the use of the suffix \u2018L\u2019. You can also write it in lowercase as \u2018l\u2019.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>v. float<\/b><span style=\"font-weight: 400;\"> &#8211; It is used to store decimal numbers. It uses 4 bytes of memory and is precise up to 6 &#8211; 7 decimal places. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">float bodyWeight = 70.5f;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">As in the case of <\/span><i><span style=\"font-weight: 400;\">long<\/span><\/i><span style=\"font-weight: 400;\">, you need to use a suffix, which can be \u2018F\u2019 or \u2018f\u2019.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>vi. double <\/b><span style=\"font-weight: 400;\">&#8211; This is another data type that you can use to store decimal values. It consumes 8 bytes of memory and is precise up to 16 decimal places.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Both float and double should not be used to store currency because it may not be precise. You can use BigDecimal for such values.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>vii.<\/b> <b>char <\/b><span style=\"font-weight: 400;\">&#8211; <\/span><b>\u00a0<\/b><span style=\"font-weight: 400;\">It is a 2-byte data type that is used to store a single character or digit. You must use single quotation marks while using char. For example &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">char firstAlphabet = \u2018A\u2019;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If you want to assign it a character in another language, you can use unicode. Unicode is an encoding system that is used to represent characters, emojis, and symbols. For example, the unicode for \u2018<\/span><span style=\"font-weight: 400;\">\u20b9\u2019 is \u2018\\u20B9\u2019 in Java.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">char currency = <\/span><span style=\"font-weight: 400;\">\u2018\\u20B9\u2019;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>viii. boolean <\/b><span style=\"font-weight: 400;\">&#8211; It is a 1-bit data type that can be assigned either of the two values &#8211; true or false.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Non-primitive or reference data types are defined by the programmer. They contain the address (reference) of an object that holds the value. Strings, arrays, classes, and interfaces are the non-primitive data types in Java.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>i. String<\/b><span style=\"font-weight: 400;\"> &#8211; It is a sequence of characters. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">String name = new String(\u201cRagini\u201d);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the above example, String has been declared like a reference data type. It is an object of the String class. However, String is used frequently in Java, so it can also be written like a primitive data type &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">String name = \u201cRagini\u201d;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A String is immutable, which means that a String object cannot be changed.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>ii. Array <\/b><span style=\"font-weight: 400;\">&#8211; It is used to store multiple values of the same data type. In the example below, you can store 100 integers in an array.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int [] primeNumbers = new int[100]<\/span><\/p>\n<p style=\"text-align: justify;\"><b>v. Variables <\/b><span style=\"font-weight: 400;\">&#8211; A variable is a memory location that stores a data value. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int year = 2020;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the example above, \u2018year\u2019 is a variable. Variables in Java can be of 3 types &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>i. Local variables <\/b><span style=\"font-weight: 400;\">&#8211; These variables are declared inside a method, constructor, or block and can only be used within it. They are created when the method, constructor, or block is executed and stop existing afterwards. Local variables do not take a default value, so you need to assign a value to them.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>ii. Instance variables <\/b><span style=\"font-weight: 400;\">&#8211; These variables are declared inside a class and outside methods, constructors, or blocks. However, they can be used inside all methods, constructors, or blocks within the same class. Instance variables are created when an object of the class is created and can be accessed by this object\/s. Depending on their data type, they have default values such as 0 for integers, null for character, or false for boolean.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii. Static variables <\/b><span style=\"font-weight: 400;\">&#8211; Like instance variables, static variables are also declared within a class but they use the keyword \u2018static\u2019. They are created when a .class file is created and are destroyed when the file stops existing. You can access static variables with the class name or object name.They can have a default value, so you don\u2019t have to assign value to them when you are declaring them.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>VI) Identifiers <\/b><span style=\"font-weight: 400;\">&#8211; As the name suggests, these are names given to classes, methods, variables, packages, and interfaces. There are certain conventions that the programmers follow while using identifiers. Although they are not hard and fast rules, you should use them so that your code is easier to read and understand. So, unless you want to be the coder that people dread in an unflattering way, stick to the convention!<\/span><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19242\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/ProgrammerComic.png\" alt=\"\" width=\"570\" height=\"570\" \/><em>Image source &#8211; techHindustan<\/em><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Here are some points that you should keep in mind &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">i. Identifiers are case-sensitive. So, <\/span><i><span style=\"font-weight: 400;\">int year<\/span><\/i><span style=\"font-weight: 400;\"> will not be the same as <\/span><i><span style=\"font-weight: 400;\">int Year<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">ii. They should begin with a letter. Although you can use special characters like underscore(_) and dollar sign ($) in Java, you should avoid using them at the beginning.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">iii. Don\u2019t use spaces. This will give you a compile-time error.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">iv. While naming classes, use nouns that indicate the purpose of the class. If you are using more than two words, then use the pascal case. This means that you need to capitalise the first letter of each word. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">class CollegeLibrary<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">v. One-word variables should be written in lowercase. For compound words, you should follow the camel case. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">String bookTitle<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">You should choose a meaningful identifier for a variable unless it\u2019s a temporary variable. For a temporary variable, the most commonly used names are i, j, k, m, and n for integers and c,d, and e for character.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">vi. Method names are generally verbs, which follow the camel case. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">issue()<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">returnBook()<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">vii. You cannot use reserved keywords such as int, char, true, false, etc.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>VII) Literals <\/b><span style=\"font-weight: 400;\">&#8211; The value that you assign to a variable is called a literal. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int NextOlympicsYear = 2021;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">2021 is a literal in the above example.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>VIII) Access modifiers <\/b><span style=\"font-weight: 400;\">&#8211;<\/span> <span style=\"font-weight: 400;\">As a Java programmer, you can use some keywords to control the accessibility of a class, constructor, method, or variable. These keywords are called access modifiers, and they are of 4 types &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>i. private<\/b><span style=\"font-weight: 400;\"> &#8211; A variable, method, or constructor that has been declared <\/span><i><span style=\"font-weight: 400;\">private<\/span><\/i><span style=\"font-weight: 400;\"> can only be used within the same class.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>ii. protected <\/b><span style=\"font-weight: 400;\">&#8211; A <\/span><i><span style=\"font-weight: 400;\">protected<\/span><\/i><span style=\"font-weight: 400;\"> variable or method can be accessed by all classes within the same package.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii. public <\/b><span style=\"font-weight: 400;\">&#8211; A class, variable, or method that has been declared as public can be accessed from any other class. <\/span><i><span style=\"font-weight: 400;\">public <\/span><\/i><span style=\"font-weight: 400;\">modifiers should be avoided in production level code.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iv. default <\/b><span style=\"font-weight: 400;\">&#8211; If you do not specify the modifier, then the class, variable, constructor, or method takes the default modifier, which allows any other class within the same package to access it.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>IX) Operators <\/b><span style=\"font-weight: 400;\">&#8211;<\/span> <span style=\"font-weight: 400;\">To put variables and data types into use, we need to use certain symbols known as operators. For example, +, -, =, etc. Operators have been divided into the following categories &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>i. Arithmetic operators <\/b><span style=\"font-weight: 400;\">&#8211; These are used to perform mathematical functions such as adding (+), subtracting (-), multiplying (*), dividing (\/), and getting remainder (%). When you use multiple arithmetic operators in the same statement, Java performs the calculation from left to right and uses a hierarchy. Multiplication, division, and modulo operation (%) are given precedence over addition and subtraction. You can also use brackets to give higher precedence. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">short discount = 2000 &#8211; (20*2000)\/100;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">When we run this in a program, we get the following output &#8211;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19244\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Output-Java-program.png\" alt=\"\" width=\"672\" height=\"338\" \/><\/p>\n<p style=\"text-align: justify;\"><b>ii. Relational operators <\/b><span style=\"font-weight: 400;\">&#8211; These are used to compare two variables or numbers, and they are of 6 types &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">greater than (&gt;), greater than equal to (&gt;=), less than (&lt;), less than equal to (&lt;=), is equal to (==), not equal to (!=)<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Relational operators return a true or false value. For example &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int age = 20;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">boolean isEligibleToVote = age &gt;= 18;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii.<\/b> <b>Assignment operators <\/b><span style=\"font-weight: 400;\">&#8211; Besides the \u2018=\u2019 operator, there are 5 types of assignment operators &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">\u00a0+=, -=, *=, \/=, %=<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">These operators can be used to avoid rewriting variables. For example &#8211;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int electricityBill = 500;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int rent = 10000;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">rent = rent + electricity bill;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The last statement can also be written as &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">rent += electricityBill;<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iii. Increment (++) and decrement (&#8211;) operators <\/b><span style=\"font-weight: 400;\">&#8211; These are used with a single operand to increase or decrease its value by 1. They can further be divided into prefix and postfix.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A prefix operator increases or decreases the value of an operand and then uses it. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = 10;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b = ++a;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In this example, the value of \u2018a\u2019 will first increase from 10 to 11 and then be assigned to \u2018b\u2019. So, the value of \u2018b\u2019 will be 11.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A postfix operator uses the value of the operand first and then increases or decreases it. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = 10;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b = a++;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In this example, the value of \u2018a\u2019 will be first assigned to \u2018b\u2019 and then change to 11. So, \u2018b\u2019 will be equal to 10 and then \u2018a\u2019 will change to 11.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><b>iv. Logical operators <\/b><span style=\"font-weight: 400;\">&#8211; These perform logic operations such as AND, OR, and NOT by using three operators.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The AND (&amp;&amp;) operator is used to compare two conditions and returns true only when both conditions are true. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int birthYear = 2000;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">if ((birthYear &gt; 1995) &amp;&amp; (birthYear &lt; 2015))<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">System.out.println (\u201cYou are from Generation Z\u201d);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the above example, both the conditions are true. So, the output will be &#8211; You are from Generation Z.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The OR (||) operator returns true when either of the conditions is true.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The NOT (!) operator is used to invert the outcome of a statement. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int a = 5;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int b = 6;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">System.out.println ( ! (a&lt;b) );<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This will print the output as <\/span><i><span style=\"font-weight: 400;\">false<\/span><\/i><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>X) Comments <\/b><span style=\"font-weight: 400;\">&#8211; You can add comments to your Java program to enhance the readability of your code. You can do this by using \/\/ followed by your statement. For example &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">byte age; \/\/ variable to store the age of the participant<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Java does not scan the comment for any errors, so you can write anything that explains the code in the best way.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">These were the building blocks for programming in Java. Now let\u2019s get our hands dirty by writing our first Java application!<\/span><\/p>\n<p style=\"text-align: justify;\"><b>3. First program in Java<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">i) Before getting started with the program, you need to first <\/span><a href=\"https:\/\/www.oracle.com\/in\/java\/technologies\/javase-downloads.html\" rel=\"nofollow\"><span style=\"font-weight: 400;\">install JDK<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">ii) Once you have installed JDK, open Notepad.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">iii) Now let\u2019s write a program to calculate age and print it.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">class Age {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">public static void main (String [ ] args) { \/\/ This is the first method that JVM accesses<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int age;\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int birthYear = 1997;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">int currentYear = 2020;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">age = currentYear &#8211; birthYear;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">System.out.print (\u201cI am\u201d + \u201c \u201c+age+ \u201c \u201c+\u201dyears old\u201d); \/\/ \u201c \u201c refers to space<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">} \/\/curly braces to close method<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">} \/\/curly braces to close class<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19245\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/First-java-program.png\" alt=\"First java program\" width=\"745\" height=\"383\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">iv) When you have written the program, save it as Age.java. You can create a folder in the C drive to save it.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19246\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Java-Program-in-Notepad.png\" alt=\"\" width=\"658\" height=\"461\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">v) Next, open your Command prompt. You can do this by going to Start &gt; Run &gt; cmd.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19247\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Command-prompt-window.png\" alt=\"\" width=\"662\" height=\"394\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">vi) Let\u2019s change the prompt to go to the directory where you have saved your file. For example, we have stored it in the C drive in a folder called MyJavaPrograms. So, we will write the following &#8211;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">cd C:\\MyJavaPrograms<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19248\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/changing-prompt.png\" alt=\"\" width=\"665\" height=\"403\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">vii) Next, enter &#8216;dir&#8217; to see the files within this directory.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">viii) Now let\u2019s compile the program.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">javac Age.java<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">You can check out <\/span><a href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/getStarted\/problems\/index.html\" rel=\"nofollow\"><span style=\"font-weight: 400;\">this<\/span><\/a><span style=\"font-weight: 400;\"> document to resolve any problems that you may be facing.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">ix) If you type &#8216;dir&#8217; again, you will see a .class file.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19249\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/After-compilation.png\" alt=\"\" width=\"664\" height=\"372\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">x) Let\u2019s run the program now.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">java -cp . Age<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">x) You should see the following output &#8211;\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-19250\" src=\"https:\/\/internshala.com\/wp-content\/uploads\/2020\/11\/Output.png\" alt=\"\" width=\"662\" height=\"414\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Congratulations! You have made your first Java application!<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">This was your first taste of programming in Java. If you want to go big, you can check out <\/span><a href=\"https:\/\/trainings.internshala.com\/java-training?utm_source=IS_Blog&amp;referral=BLOG10&amp;utm_medium=basics_of_Java_article\"><span style=\"font-weight: 400;\">Internshala\u2019s Core Java training<\/span><\/a><span style=\"font-weight: 400;\"> and create applications such as the Connect4 game! You can also use coupon code BLOG10 to get a discount of 10%.\u00a0<\/span><\/p>\n<aside class=\"mashsb-container mashsb-main \"><div class=\"mashsb-box\"><div class=\"mashsb-count mash-medium\" style=\"float:left\"><div class=\"counts mashsbcount\">347<\/div><span class=\"mashsb-sharetext\">SHARES<\/span><\/div><div class=\"mashsb-buttons\"><a class=\"mashicon-facebook mash-medium mashsb-noshadow\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Finternshala.com%2Fblog%2Fgetting-started-with-java-basics-of-java%2F\" target=\"_top\" rel=\"nofollow\"><span class=\"icon\"><\/span><span class=\"text\">Share&nbsp;on&nbsp;Facebook<\/span><\/a><a class=\"mashicon-subscribe mash-medium mashsb-noshadow\" href=\"#\" target=\"_top\" rel=\"nofollow\"><span class=\"icon\"><\/span><span class=\"text\">Get&nbsp;Your&nbsp;Dream&nbsp;Internship<\/span><\/a><div class=\"onoffswitch2 mash-medium mashsb-noshadow\" style=\"display:none\"><\/div><\/div>\n            <\/div>\n                <div style=\"clear:both\"><\/div><\/aside>\n            <!-- Share buttons by mashshare.net - Version: 4.0.42-->","protected":false},"excerpt":{"rendered":"<p>This year, Java turned 25. If you have ever felt grateful for LinkedIn, Twitter, or Facebook, then it\u2019s not too late to send in your wishes to Java! Although there<\/p>\n","protected":false},"author":5355,"featured_media":19230,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[675,3943,4134,3889,1594,4171],"tags":[343,4156],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Getting started with Java: Basics of Java - Internshala blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with Java: Basics of Java - Internshala blog\" \/>\n<meta property=\"og:description\" content=\"This year, Java turned 25. If you have ever felt grateful for LinkedIn, Twitter, or Facebook, then it\u2019s not too late to send in your wishes to Java! Although there\" \/>\n<meta property=\"og:url\" content=\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\" \/>\n<meta property=\"og:site_name\" content=\"Internshala blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-17T17:45:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-30T03:19:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2020\/11\/Basics-of-Java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"390\" \/>\n\t<meta property=\"og:image:height\" content=\"250\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Internshala\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Internshala\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\"},\"author\":{\"name\":\"Internshala\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20\"},\"headline\":\"Getting started with Java: Basics of Java\",\"datePublished\":\"2020-11-17T17:45:23+00:00\",\"dateModified\":\"2020-11-30T03:19:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\"},\"wordCount\":2526,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/internshala.com\/blog\/#organization\"},\"keywords\":[\"Java\",\"Programming\"],\"articleSection\":[\"Available Trainings\",\"e-Learning\",\"Learning Tracks\",\"Online Training\",\"Programming\",\"Training SEO articles\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\",\"url\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\",\"name\":\"Getting started with Java: Basics of Java - Internshala blog\",\"isPartOf\":{\"@id\":\"https:\/\/internshala.com\/blog\/#website\"},\"datePublished\":\"2020-11-17T17:45:23+00:00\",\"dateModified\":\"2020-11-30T03:19:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/internshala.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learning Tracks\",\"item\":\"https:\/\/internshala.com\/blog\/learning-tracks\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Programming\",\"item\":\"https:\/\/internshala.com\/blog\/learning-tracks\/programming\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Getting started with Java: Basics of Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/internshala.com\/blog\/#website\",\"url\":\"https:\/\/internshala.com\/blog\/\",\"name\":\"Internshala blog\",\"description\":\"Your favourite senior outside college\",\"publisher\":{\"@id\":\"https:\/\/internshala.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/internshala.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/internshala.com\/blog\/#organization\",\"name\":\"Internshala blog\",\"url\":\"https:\/\/internshala.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png\",\"contentUrl\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png\",\"width\":112,\"height\":31,\"caption\":\"Internshala blog\"},\"image\":{\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20\",\"name\":\"Internshala\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png\",\"contentUrl\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png\",\"caption\":\"Internshala\"},\"description\":\"Internshala is India\u2019s leading early-career platform, helping students and fresh graduates find internships, jobs, and online trainings. With over a decade of experience in empowering young professionals, Internshala shares insights and resources to help them build successful careers.\",\"sameAs\":[\"http:\/\/blog.internshala.com\",\"https:\/\/www.linkedin.com\/company\/internshala\/\"],\"url\":\"https:\/\/internshala.com\/blog\/author\/internshala\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting started with Java: Basics of Java - Internshala blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/","og_locale":"en_US","og_type":"article","og_title":"Getting started with Java: Basics of Java - Internshala blog","og_description":"This year, Java turned 25. If you have ever felt grateful for LinkedIn, Twitter, or Facebook, then it\u2019s not too late to send in your wishes to Java! Although there","og_url":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/","og_site_name":"Internshala blog","article_published_time":"2020-11-17T17:45:23+00:00","article_modified_time":"2020-11-30T03:19:53+00:00","og_image":[{"width":390,"height":250,"url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2020\/11\/Basics-of-Java.jpg","type":"image\/jpeg"}],"author":"Internshala","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Internshala","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#article","isPartOf":{"@id":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/"},"author":{"name":"Internshala","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20"},"headline":"Getting started with Java: Basics of Java","datePublished":"2020-11-17T17:45:23+00:00","dateModified":"2020-11-30T03:19:53+00:00","mainEntityOfPage":{"@id":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/"},"wordCount":2526,"commentCount":4,"publisher":{"@id":"https:\/\/internshala.com\/blog\/#organization"},"keywords":["Java","Programming"],"articleSection":["Available Trainings","e-Learning","Learning Tracks","Online Training","Programming","Training SEO articles"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/","url":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/","name":"Getting started with Java: Basics of Java - Internshala blog","isPartOf":{"@id":"https:\/\/internshala.com\/blog\/#website"},"datePublished":"2020-11-17T17:45:23+00:00","dateModified":"2020-11-30T03:19:53+00:00","breadcrumb":{"@id":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/internshala.com\/blog\/getting-started-with-java-basics-of-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/internshala.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Learning Tracks","item":"https:\/\/internshala.com\/blog\/learning-tracks\/"},{"@type":"ListItem","position":3,"name":"Programming","item":"https:\/\/internshala.com\/blog\/learning-tracks\/programming\/"},{"@type":"ListItem","position":4,"name":"Getting started with Java: Basics of Java"}]},{"@type":"WebSite","@id":"https:\/\/internshala.com\/blog\/#website","url":"https:\/\/internshala.com\/blog\/","name":"Internshala blog","description":"Your favourite senior outside college","publisher":{"@id":"https:\/\/internshala.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/internshala.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/internshala.com\/blog\/#organization","name":"Internshala blog","url":"https:\/\/internshala.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png","contentUrl":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png","width":112,"height":31,"caption":"Internshala blog"},"image":{"@id":"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/f0be3a17aa62a7b75486919fd00ecb20","name":"Internshala","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png","contentUrl":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2025\/10\/IS-Logo-96x96.png","caption":"Internshala"},"description":"Internshala is India\u2019s leading early-career platform, helping students and fresh graduates find internships, jobs, and online trainings. With over a decade of experience in empowering young professionals, Internshala shares insights and resources to help them build successful careers.","sameAs":["http:\/\/blog.internshala.com","https:\/\/www.linkedin.com\/company\/internshala\/"],"url":"https:\/\/internshala.com\/blog\/author\/internshala\/"}]}},"_links":{"self":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts\/19229"}],"collection":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/users\/5355"}],"replies":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/comments?post=19229"}],"version-history":[{"count":0,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts\/19229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/media\/19230"}],"wp:attachment":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/media?parent=19229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/categories?post=19229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/tags?post=19229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}