Author: admin
-
Java – Access Modifiers
Java Access Modifiers The access modifiers in Java are used to specify the scope of the variables, data members, methods, classes, or constructors. These help to restrict and secure the access (or, level of access) of the data. There are four level of access: In this tutorial, we will learn about the Java access modifier and their various types along with the…
-
Java – Constructors
Java Constructors Java constructors are special types of methods that are used to initialize an object when it is created. It has the same name as its class and is syntactically similar to a method. However, constructors have no explicit return type. Typically, you will use a constructor to give initial values to the instance variables defined by the class or to…
-
Java – Variable Scopes
The variable’s scope refers to the region where they are created and accessed in a given program or function. The variable scope also refers to its lifetime. In this tutorial, we will learn about the scopes of the different types of Java variables. Scope of Java Instance Variables A variable which is declared inside a class and outside…
-
Java – Methods
Java Methods A Java method is a collection of statements that are grouped together to perform an operation. When you call the System.out.println() method, for example, the system actually executes several statements in order to display a message on the console. In this tutorial, we will learn how to create your own methods with or without return values, invoke…
-
Java – Class Methods
Java Class Methods The class methods are methods that are declared within a class. They perform specific operations and can access, modify the class attributes. Creating (Declaring) Java Class Methods Class methods declaration is similar to the user-defined methods declaration except that class methods are declared within a class. The class methods are declared by specifying the access modifier followed by the return type, method_name,…
-
Java – Class Attributes
Java Class Attributes Java class attributes are the variables that are bound in a class i.e., the variables which are used to define a class are class attributes. A class attribute defines the state of the class during program execution. A class attribute is accessible within class methods by default. For example, there is a class “Student” with…
-
Java – Object and Classes
Java Classes and Objects Java is an Object-Oriented programming language. In Java, the classes and objects are the basic and important features of object-oriented programming system, Java supports the following fundamental OOPs concepts – In this tutorial, we will learn about Java Classes and Objects, the creation of the classes and objects, accessing class methods, etc. Java Classes A class is…
-
Java – OOPs (Object-Oriented Programming) Concepts
OOPs (Object-Oriented Programming System) Object means a real-world entity such as a mobile, book, table, computer, watch, etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies software development and maintenance by providing some concepts. In this tutorial, we will learn about the concepts of Java (OOPs)…
-
Interfaces in C++ (Abstract Classes)
An interface describes the behavior or capabilities of a C++ class without committing to a particular implementation of that class. The C++ interfaces are implemented using abstract classes and these abstract classes should not be confused with data abstraction which is a concept of keeping implementation details separate from associated data. A class is made abstract by…
-
Data Encapsulation in C++
All C++ programs are composed of the following two fundamental elements − Encapsulation is an Object Oriented Programming concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse. Data encapsulation led to the important OOP concept of data hiding. Data encapsulation is a mechanism of…