Casting operator

From Abap2Java

Jump to: navigation, search

Image:Dotright.JPG ABAP

To convert a variable with a certain data type into another data type, a cast is necessary. A cast can be done implicitly using a simple assignment (widening cast), or using the casting operator ?=.

lr_car     = lr_porsche.
lr_porsche ?= lr_car.

Image:Dotleft.JPG Java

Translation:
(...)

lr_car     = lr_porsche;
lr_porsche = (cl_porsche) lr_car;
Personal tools