java - How to access a typecasted object's method directly? -
It looks like a basic object oriented problem, but I was coming from Pascal / Delphi background, and I Similar method to get the same result.
In Pascal / Delphi, I can change something like this (this is not entirely true, but just to give you an example):
var A: teabton; B: string; Start one: = getObject (request)); B: = a.caption; End;
In:
var b: string; Start b: = TeTube (getObject (request)). Caption; End;
But how to get the same solution in Java? How to change:
button a; String B; A = (button) getObject (request); B = a.caption;
in
string b; B = (button) getObject (request). Caption;
Or something like this? The point is, I want to eliminate the need to declare a variable variable to hold an object, if I want to take another value (or object) inside that object. But the problem is that the object should be typed, because what I get is just a normal object getObject ()
function Thanks for your help.
I will do the following:
b = (string) (( Button) getObject (request). Captions
Comments
Post a Comment