What are Enums in Java? In computer languages, enumerations are used to express a collection of named constants. For instance, it can be used for weekdays, colors, and vowels. Enums are employed when all possible values are known at the time of compilation, as in the case of menu options, rounding modes, command-line inputs, etc. […]
July 12, 2022 | Java | No comments
The java.lang.Thread class is a thread of execution in a program. The Java Virtual Machine enables an application to run multiple execution threads simultaneously. The following are crucial details about Thread: Each thread is given a priority. Higher priority threads are prioritized for execution over lower-priority threads. Each thread could or might not be designated […]
June 30, 2022 | Java | No comments
The instanceof operator is used to determine whether or not a reference variable contains a specific type of object reference. Because it compares the instance to the type, the instanceof operator in Java is also known as the type comparison operator. It either returns true or false. We get false when using the instanceof operator […]
June 3, 2022 | Java | No comments
Garbage collection is the method through which Java programs maintain their memory automatically. working: Java programs are compiled into bytecode that may be executed by a Java Virtual Machine, or JVM. Objects are produced on the heap, which is a part of memory dedicated to the Java application, while it runs on the JVM. Some […]
May 28, 2022 | Java | No comments
this is a Java keyword that refers to the current object of a class. Uses of this keyword: The following are some examples of how to utilize this keyword: this can be used to refer to the current instance variable of a class. this can be used to call the method of the current class […]
May 27, 2022 | Java | No comments
In Java, inheritance is a mechanism by which one object inherits all of its parent’s properties and behaviors. It is an essential component of OOPs (Object-Oriented programming systems). You can use the parent class’s methods and fields when you inherit from an existing class. You can also add new methods and fields to your current […]
May 19, 2022 | Java | No comments
Modifiers in Java are divided into two categories: access modifiers and non-access modifiers. The accessibility or scope of a field, method, constructor, or class is defined by the access modifiers in Java. The access modifier can be used to change the access level of fields, constructors, methods, and classes. Types of access modifiers: There are […]
May 14, 2022 | Java | No comments
Everything revolves around the object in Java, which is an object-oriented language. An object represents a class’s runtime entity and is required to call the class’s variables and methods. A Java object is a member of a Java class (also known as an instance). There is an identity, a behavior, and a state for each […]
May 8, 2022 | Java | No comments
An array is a collection of variables of the same type that are referenced by a common name. Arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element. Need for Arrays: The primary reason for arrays’ existence is that they allow for the […]
May 7, 2022 | Java | No comments
Multiple initialization and update Expression: A for loop may contain multiple initialization and/or multiple update expression. Optional Expression: All the three expressions of the for loop are optional. Infinite Loop: An infinite loop is an endless loop which can be created by omitting the test-expression. Empty Loop: This is also known as a time delay […]
May 6, 2022 | Java | No comments