Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Java - What is it?

Banned
Banned
Joined
Feb 9, 2007
Messages
1,313
Reaction score
177
Hello everyone,


After much insistence, there is now a Java class. Java is (in my opinion) a very nice language and you can have lots of it. You can use with it with making games, apps and Android apps / games. It is convenient that the natural cross-platform and can be. Therefore used both on Mac, Windows and Linux.

Java is object-oriented language and the family of C languages. Object-oriented means that you work a lot with objects and assign certain synax. You leave so objects process certain data. A simple example is that for example a TextView (an object in XML) assign a specific text. In Java (android) would be just about this:

Code:
[COLOR=#000000](TextView) tvexample1 = (TextView) findViewById(R.id.tvexample1);
[/COLOR]


Sets the variable.

Code:
[COLOR=#000000]tvexample1.setText("Hello RageZONE"); 
[/COLOR]


Sets the text of the textview.

In the first line I tell with (TextView) that the object I define a 'TextView is (Android syntax) then I give the variable a name tvexample, then I define again that it is a TextView and I look with a certain method where tvexample1 in the layout state. Then I give the variable a function (setText).

This is quite confusing for most of you but this was just to show what is meant by object-oriented (tutorials to follow). As you've already seen, knowledge of the C language is really a requirement to learn this.

I am very motivated and wanted you to quickly learn what fun things. If you do not understand the above code, do not worry I'll explain everything from the beginning once I start my other tutorials.

So please give as much feedback & Suggestions possible. I can use your suggestions and Feedback for the future of making tutorials and therefore i really need them!

Don't forget to make my reputation as green as possible and like the post if I've really helped you.




 
JavaScript Is Best Script
Joined
Dec 13, 2010
Messages
631
Reaction score
131
In the first line I tell with (TextView) that the object I define a 'TextView is (Android syntax) then I give the variable a name tvexample, then I define again that it is a TextView and I look with a certain method where tvexample1 in the layout state. Then I give the variable a function (setText).

No offence... but C (and I mean solely C alone, excluding C++, C#) programmers will be very confused trying to understand this paragraph, 'cause of the many questions left unanswered:

1) Is "(TextView)tvexample1" a declaration or just an assignment?
2) Is "(TextView) findViewById(R.id.tvexample1)" object casting or pointer casting?
3) Is "R.id.tvexample1" passed by reference or value into "findViewById"?
4) Is "TextView" a struct or a class?
5) Wtf is a class anyway? (Supposedly a joke, since C doesn't have classes)
6) Are you sure the "setText" function would only have to accept string arguments? (Supposedly another joke, since C doesn't have function overloading).

Jokes aside, C is still a wonderful language, but the point is that although the C languages (including C++ and C#) and Java are very, very similar syntax-wise, Java's concept of "object-oriented" is very unique and should not be confused as that of the C languages. One example which is the ability to override methods to objects upon instantiation. Consider the following:
Code:
MyClass c1 = new MyClass(){
    @Override
    public void Cry(){
        System.out.printLln("Lol1");
    }
}
MyClass c2 = new MyClass(){
    @Override
    public void Cry(){
        System.out.printLln("Lol2");
    }
}
c1.Cry(); // Outputs "Lol1"
c2.Cry(); // Outputs "Lol2"
As you can see, the above code, though valid and very useful in Java, isn't gonna work for the C languages, because their ideas of Encapsulation are rather different.

So after beating around all this bush, the point is, i hope you would give the viewers a very, very thorough introduction to Java while keeping in mind the fact that they come from a C background, and pinpoint the mistakes they might have as a result.

BTW I don't think think an "Android syntax" exists, it should be code written in "Java syntax" and targeting the Android library.
 
Back
Top