Home > Java > Java – Pointer/Reference/Preprocessor

Java – Pointer/Reference/Preprocessor

Java we dont have Pointer ( *) and Preprocessor (#if or #define)  like (ADA and C we have)

For example:
=========

int main(void)
{
    struct tag *st_ptr;         /* a pointer to a structure */
    st_ptr = &my_struct;        /* point the pointer to my_struct */
    strcpy(my_struct.lname,"Shamun");
    strcpy(my_struct.fname,"Foo");
    printf("\n%s ",my_struct.fname);
    printf("%s\n",my_struct.lname);
    my_struct.age = 63;
    show_name(st_ptr);          /* pass the pointer */
    return 0;
}

 

@Good:

Java uses References ( like c/c++)

@Bad:

we cant make easyly this:  System.out.print(“Hello world”);  like this: echo “Hello world”;

http://www.hecl.org – implemented somthing like that.

Advertisements
Categories: Java
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: