Site icon TestingDocs.com

Adding Fields to a Class using Raptor

Introduction

In this article, we will learn to add fields to a class using the Raptor flow chart. The class state can be defined by the values of the fields.  In this tutorial, we will add fields to Car class.

Car class

Let’s add fields of Car and the data types of the variables are shown below:

model: String

make: String

color: String

price: double

Adding a field to a Class

Right-click on the Class >> Edit members >> Click on New Field button.

Add the name, data type, and Access specifier for the field.

Private fields can only be accessed in the class

Protected fields can be accessed in the class and in the sub classes of the class.

Public fields can be accessed anywhere.

 

You can check the checkboxes static, final if you want the variable to be static and constant respectively. Repeat the steps to add all the variables to the Car class.

 

 

Raptor Tutorials on this website can be found at:

https://www.testingdocs.com/raptor-a-flowchart-tool/

RAPTOR official website: https://raptor.martincarlisle.com/

Exit mobile version