Android Attack! “Java on Java”

I set on this venue with zero to no Java experience, but with some C# experience. Which share some similarities and major differences. But the time has come for me to advance into the world of Java and Eclipse. So I’ll be breaking down my Java into a few different parts. (How many? No idea :D)

I’ll start with a basic Java code:

public class  {
    public static void main(String[] args) {

        String testMessage = "This is a test";
	String mySecondMessage = " demo"

	System.out.println("This is another test!");

	int firstNumber = 55;
	int secondNumber = 10;

	int result = firstnumber + secondNumber;

	double myValue = 1234.3455;

	double mySecondValue = 9876.545;

This code will store it’s respected variable (tesMessage, mySecondMessage, firstNumber, secondNumber, myValue, and mySecondValue) and print them out.

With the output being:
This is another test!
This is a test demo

String, int, and double are just some of the data types available in Java. A string is a sequence of characters: “Hi Buddy” (quotes must be used, whether double or single quote doesn’t matter.) An int is the default data type for integral values: 23, 344, 354423, and etc. Double is the main data type for decimal values: 23.45, 35.89, 2456453.24, and etc.

Variable naming convention in Java is to have the starting word to be lowercase and the subsequent first letter of each word should be uppercased; helloWorld.

Later on I will continue with classes and inheritances!

Go high five someone! – Randy


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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s