Exceptions are the runtime error in a program encountered while execution. Basically there are two type of Errors exist in any program. Compiler Error: These are the error in the code itself. It means syntax error. Few examples are given below: a semicolon(;) missing at the end of the statement. Grammatical error while using theRead More
Basic
Basic Java – 23 || String, StringBuffer & StringBuilder in Java.
All these classes String, StringBuffer & StringBuilder used to declare, initialize, and manipulation a String objects. String A String is a class we use to declare and initialize the string literals. These string literals are basically the group of characters. In general, strings are immutable. In other words, each time we perform any modification inRead More
Basic Java – 22 || Let’s learn more about String.
String is a sequence of characters. But technically in Java, String is treated as a class and we have to create an object of that class to generate a string. String Object There are two ways to create a string object. Direct initialization or via string literal: This is a very easy and most usedRead More
Basic Java – 21 || Stack memory and Heap memory in Java.
Stack memory and Heap memory are the two important components of JVM. Whenever a program execution starts JVM allocates memory to all the class, object, methods, variables. Stack Memory Basically used for thread execution. It works in LIFO (Last in First Out) manner. As soon as any method encountered JVM allocates memory to the primitiveRead More
Basic Java – 20 || Sending Email with attachment using Java (Part-2).
In the last chapter, we have learned sending email using Java. In this chapter, we will go a little in-depth and will learn a few important things like multiple recipients, attachments, marking cc or bcc, etc. Key Highlights in this chapter Single recipient or email id for To field message.setRecipient(RecipientType.TO, new InternetAddress(recieverID)); Multiple recipients orRead More
Basic Java – 19 || Sending Email using Java (Part-1).
After the successful execution of any program or tool, it is better to share status or report via sending email to the stakeholders. This objective can be achieved by javax.mail package. javax is an extended version of Java which contains many sub-packages to give additional features to Java language. One of the most important featuresRead More
Basic Java – 18 || Difference between break and continue keywords.
Both break and continue are the reserved keywords in java. These are mainly used while using switch or loops in the program. break and continue In the above image, we can see the difference between these two keywords. When we are using a break keyword it exits from the current loop or a switch blockRead More
Basic Java – 17 || Runtime User Input using Console Class (Part-3).
There is also a third way to take user input via using Console class. This method helps a user to take inputs via Command Prompt. Before proceeding further, I would request you to please read the first two parts of this tutorial. Basic Java – 15 || Runtime User Input using Scanner Class (Part-1). BasicRead More
Basic Java – 16 || Runtime User Input using BufferedReader Class (Part-2).
An alternate method to take user input is BufferedReader class. Unlike Scanner class, BufferedReader is fast and simple. If you don’t have read about Scanner Class, would request you to please have a look and understanding of Scanner Class, please visit the previous chapter: Basic Java – 15 || Runtime User Input using Scanner Class (Part-1).Read More
Basic Java – 15 || Runtime User Input using Scanner Class (Part-1).
Scanner Class is the commonly used way of taking user inputs. There are many instances where user interaction is needed at runtime during the Program execution. Scanner Class It can be used via java.util.Scanner library files. There is a major role of Whitespace and Enter while taking user inputs using Scanner class. These user inputsRead More