Consider this random object:
Object Test of Class TestClass:
String Name;
Integer Age;
procedure setName(n);
function getName(): String;
In Delphi if we want to work easily with many properties and methods of an object we can do this way:
Test.Name = 'EASI';
Test.Age = 34;
Test.setName('Eduardo Alcantara');
ShowMessage(Test.getName);
...or we can do it that way:
with Test do
begin
Name = 'EASI';
Age = 32;
setName('Eduardo Alcântara');
ShowMessage(getName);
end
Is there a similar structure in Java where we could shorten syntax like we can in Delphi?