In this post, you will learn to: Describe final variables. Describe final methods. State the purpose of final classes. ‘final’ Variables Many programming languages have a specific keyword to define constant identifiers or to hold values that are not likely to change during the execution of the program. In Java, the final keyword is used […]
Archives for October 2021
Using ‘abstract’ Keyword in Java
In this post, you will learn to: State the use of abstract methods. Explain the purpose of abstract classes. ‘abstract’ Methods When a method has only declaration and no implementation, that is, no statements in the body, then it is called an abstract. An abstract method in Java is prefixed with the abstract keyword. An […]
Overloading of Methods in Java
In this post, you will learn to: Explain the concept of overloading. Describe overloading using different number of parameters and same data types. Describe overloading using same number of parameters and different data types. Discuss constructor overloading. State the use of this keyword. Concept of Overloading Method overloading is the ability of a class to […]
Introduction to Java Inheritance
In this post, you will learn to: Explain the concept of inheritance. State the purpose of method overriding. State the use of a super keyword. Explain covariant return types. Inheritance in Real World In a family, the traits of parents are often inherited by their children. In addition to having unique traits and behavior of […]
Java Field and Method Modifiers
In this post, you will learn to: Define field and method modifiers. State the use of volatile modifiers. Explain the use of native modifiers. Describe the transient modifier and its use. List the rules for using access control specifiers. Field and Method Modifiers Field and method modifiers are keywords used to identify fields and methods […]
Java Access Modifiers
In this post, you will learn to: State the purpose of access modifiers. Identify the use of public access specifier. State the purpose of private access specifier. State the use of protected access specifier. State the use of default or package access specifier. List the rules for using access specifiers. Access Modifiers Access specifiers or […]
Introduction to Java Packages
In this post, you will learn to: Identify the features of packages and their types. State the steps for creating and using user-defined packages. Explain static imports A Java package is a group of related classes and interfaces organized as one unit. The fully qualified name of the class includes the package it belongs to. […]
Java String Classes – StringBuilder and StringTokenizer
In this post, you will learn to: Explain StringBuilder class and its methods. Explain StringTokenizer class and its methods. ‘StringBuilder’ Class The StringBuilder class provides various methods to manipulate the string object. Objects of StringBuilder class are growable and flexible. Characters or strings can be inserted in the StringBuilder object and they can also be […]
Java Strings Basics
In this post, you will learn to: Describe strings. Describe the various methods of String class. Describe a String array and its use. Describe command line arguments in Java and their uses. Consider an application, that maintains employee information, such as Employee ID, name, type of work and salary details. With the help of the […]
Arrays in Java
In this post, you will learn to: Define an array. Explain single-dimensional arrays. Describe two-dimensional arrays. Explain searching and sorting in arrays. Need of an Array Variables can be used to store and manipulate values. Only one value can be stored in one variable at one point in time. This means that in case you […]