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
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 […]
Java Initializers basics
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 […]
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 […]