Skip to main content

[BD-J-DEV] Private attributes and object literals...

1 reply [Last post]


A newbie question on initializing private attributes within object
literals: Private attributes can not be initialized in an object
literals defined in a different compilation unit. But, it is okay to
initialize private attributes in object literals defined in the same
compilation unit. Is that the language rule?

Example: The attached Person.fx compiles without errors. But, if we
compile Person.fx and Main.fx together, we get a compilation error on
Main.fx at object literal.

var o = Person {
name : "Sundar",
age: 2
public class Person {
private attribute name : String;
public attribute age : Integer;

var p = Person {
name: "Sun",
age: 20

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-05-26


I'm sorry. Please ignore my question. It was intended for a different forum.

-A. Sundararajan