Win a copy of Rust Web Development this week in the Other Languages forum!

pagano monello

Ranch Hand
+ Follow
since Oct 17, 2014
pagano likes ...
Netbeans IDE
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by pagano monello

Ps. I would add the following consideration:
    I guess that it wouldn't be that difficult to define a coloured rectangle to be output to indicate a node. However, I fear that positioning the various nodes reciprocally in space would be an extremely difficult task.
I've studied some Java as a self-taught. To let you guess my knowledge level, and my skills, I specify that:
  • I've studied the OCA Prep Guide by Mala Gupta
  • I've studied the OCA Prep Guide by Mala Gupta
  • I've followed a C++ Course on Object-Oriented Programming
  • I have a grasp on Design Patterns. I've partially read "PHP Objects, Patterns, and Practice" by Matt Zandstra. In this regard, I would like to point out that I have just a very basic knowledge about Patterns
  • I've never worked on Frameworks
  • I'm not a professional software developer

  • Currently, I'm employed as a middleware system administrator. I work with products similar to IBM WebSphere MQ.

    Middleware systems are composed of entities such as Nodes, Queues, Links etc... In a sense, they are very similar to computer networks

    Then, I would like to try developing a graphical software that, basically, would use the attributes that define those entities to build a topologic diagram that depicts the network.

    For instance, let's say that the entity Note had the following attributes:

    + -------------+
    |      Node      |
    |  NodeName  |
    |   NodeType   |
    |   NodeSize    |  

    Those attributes are stored in plain text files.

    Can anyone then suggest me a book that I can read to learn the basics on this topic? It would be great if it was not too much long and possibly down-to-earth, I have very little time to study.

    I'm sorry for the length of this message.
    Thank you for the additions, really, and thank you for indicating me your post about final instance variables. I'm gonna read it, after drawn breath.
    Hi Roel,
    thank you for your last post. So now I think I have understood that method parameters and local variables are not assigned by default, so I must be careful:
  • local variables: I must assign them explicitly if I want to use them, otherwise the code won't compile
  • method parameters: I must be sure to pass a correct values for method parameters when invoking a method, otherwise the code won't compile

  • Thank you really

    so I guess that an interesting difference between a reference variable (instance or class variable) and a local parameter (or a method parameter) can be the following:
  • reference variables: are initialized by default to null when an object is created
  • local parameters and method parameters: are not assigned by default to any value
  • Hi Ankit,
    thank you for your explanation, I am impressed by it.

    Then, I think you told me that:
  • if I use a reference variable (mov) in a class, this variable is initialized to null when an object is created (now mov is an attribute of an object of class Fun). In this case the reference variable is an instance variable.
  • on the other hand, if I use a reference variable (mov) as a method parameter, it's just a reference variable, and not an instance variable, so in this case of course it isn't attribute of an object, therefore it doesn't need to be instantiated to any value.

  • The following schema is great!

    I really like it!

    Thank you

    Now when you instantiate the Fun class, reference variable m will be assigned a null value, because that's the default value for instance and class reference variables.

    I do not understand in which way I am instantiating class Fun. I think I am not instantiating class Fun in this snippet.
    I think I must correct myself, in fact I think that I was wrong when I said:

    However I think that, in this way, we define a reference variable which points to a null value (default value for reference variables)

    Now I want to refer to another code snippet, as it follows:

    I the first instance variable (f1) doesn't point to any object, because I have not instantiated class Fun by using the new operator (new Fun();).
    On the other hand the instance variable points to a null object. Am I right, I am not?
    Up to now I can only say that I am admired by the accuracy of both answer; so I can say just thank you.

    I need time to read them, what you wrote to me is not banal.

    Thank you, really.
    I have read a code which puzzles me a little. I write the code below:

    What surprises me is that the definition of a variable of type interface (Movable mov) is allowed. In effect, in this way, we don't instantiate the variable, which would be completely wrong. However I think that, in this way, we define a reference variable which points to a null value (default value for reference variables); to me, this means that move points to something, or is trying to point to something, which cannot be nothing but an object (null in this case), and I am inclined to believe that it is not correct.

    What I may conclude is just the following rule (which is just a rule I deduce from the context, but which is not so clear to me): it's not allowed to instantiate interface variables, but it is correct to define interface variables, which point to null.

    I am sorry, what I wrote may be not so clear: actually it's not simple to write about this stuff.

    Thank you really in advance.
    Hi Roel,
    thank you for your answer, I am gonna read the topic you suggested me; this thing is a little tricky.
    Thank you also for having updated the title of the topic which was actually wrong.

    I have tried the following expression:

    the result surprises me. In fact I expected 21, it seems to me that the postfix hasn't been valued. Any suggestion about it?

    Thank you in advance.
    Hi Roel,
    thank you for your answer, which is totally clear, as always.

    pagano monello
    Hi there,
    I have three question about primitive data types:

    1. Is there any reason why short values doesn't have a suffix neither a prefix? I think that suffixes and prefixes make more sense to distinguish between the different numeration systems (octal, hexadecimal...), rather than between the different data types (int, long...); however long values can have prefix L or l. It sounds weird to me. Also: is there any difference in omitting or not the suffix for long values?

    2. I read that casting is allowed only between compatible types. Does it mean that it is possible to cast only from a numeric type to another numeric type (or char)? In other worlds, does it mean that it's not allowed to cast just numeric types (or char) with boolean? Actually I am not sure to have clearly understood when it is allowed to cast from a type to another, and when it isn't.

    3. I have noticed that I can use the hexadecimal notation, even if I am defining an byte variable; this thing doesn't make a lot of sense, according to me. I hope I mustn't expect tricky questions with hexadecimal values stored in binary variables in OCA SE 7 Exam; it would be a mistake guaranteed.

    Thank you in advance.
    pagano monello
    Ah wow, I re-read slowly this piece of post:

    In case of variables, static methods, and private instance methods, this decision is made by the compiler. Why? Nothing special here. It is a rule of Java language. The compiler will decide which member will be used by an expression. The JVM simply uses that particular member as per compiler's decision. How does the compiler decide? Compiler has no knowledge about the actual objects referred to by a variable, right? (Because actual objects are created by by the JVM at run time.) Compiler does have an fair idea but it doesn't know that for sure. So obviously, it cannot decide based on the object type. All it is left with is the variable type.

    So I may have understood: in this case, the type of the variable is decided by the compiler; anyway the compiler doesn't know which is the actual object, then it lets the variable type.

    Thank you, really.
    Thank you Paul for your last reply.
    Sure, I know the difference between "type of variable" and "type of an object referred to by a variable"; anyway I guess I am not used enough to manage this stuff yet.

    What is still quite difficult to understand is the difference in what it happens at compile time and what at runtime.

    I think that I must to be patient, and reason about it.