In this post, you will learn to: Describe initializers. State the syntax of variable initializers. State the syntax of instance initializers. Concept of Initializers Initializers are small pieces of code embedded in curly braces that perform initialization. Besides using constructors for initializing, initializers can be used for initializing. The different types of initializers are as […]
Archives for October 2021
Java Instance Methods
In this post, you will learn to: Explain the purpose of instance methods and its naming conventions. Describe variable-argument methods. Concept of Instance Methods An instance method is defined as the actual implementation of an operation on an object. It specifies the steps or the manner in which the requested operation is to be carried […]
Java Instance Variables
In this post, you will learn to: State the purpose of instance variables. State the syntax of declaring instance variables. Concept of Instance Variables Instance variables are used to store information about an entity. Consider a scenario, wherein a car dealer wants to keep track of the price of various cars in stock. So, to […]
Java Classes and Objects
In this post, you will learn to: State the syntax for declaring classes and conventions for naming them. Describe constructor and state its syntax. State the syntax of creating objects. Declaring Classes A class declaration should contain the keyword class and the name of the class that is being declared.Besides this, following are some conventions […]
Java Jump Statements – break, continue, labeled statement
In this post, you will learn to: State the purpose of jump statements. Describe break statement. Describe continue statement. Explain labeled statement. Compare break and continue statements. Purpose At times, the exact number of times the loop has to be executed is known only during runtime. In such a case, the condition to terminate the […]
Loops in Java – while loop and for loop
In this post, you will learn to: Identify the need for a loop and list the types of loops. Explain the while statement and the rules associated with it. Identify the purpose of the do-while statement. State the need of for statement. Describe nested loops. Compare the different types of loops Need for Loops A […]
Java if and switch-case Statements
In this post, you will learn to: Identify the need for decision-making statements and its types. Explain various forms of the if statement. Explain the switch-case statement. Compare the if-else and the switch-case construct. Purpose and Types A Java program is a set of statements, which are executed sequentially in the order in which they […]
Basics of Java Operators
In this post, you will learn to: Describe an operator and explain its purpose. Identify and explain the use of Assignment, Arithmetic, and Unary operators. Identify and explain the use of Equality, Relational, and Conditional operators. Identify and explain the use of Bitwise and Bit Shift operators. Explain operator precedence. Explain operator associativity. Purpose All […]
How to Change or Rename a Mount Point in Linux
As a Linux admin, you must have got a request for renaming a mount point. Well, it is fairly easy to rename the mount point name in Linux, but it needs some mount point. Note: You may have clustering software like Veritas Infoscale or PCS cluster which might be controlling the mount point configuration. This […]
How to format Output and Input in Java
In this post, you will learn to: State the different format specifiers in Java. Identify the methods for accepting formatted input. List the various escape sequence characters in Java. Format Specifiers Whenever an output is to be displayed on the screen, it needs to be formatted. The formatting can be done with the help of […]