Showing posts with label beginners. Show all posts
Showing posts with label beginners. Show all posts

Wednesday, 13 November 2013

Using int and double

1. Using int
int speed = 60;

Like I said in previous post integer variables can only hold whole values. In this example we assigned value of "60" to the variable "speed". Now if we print the value of "speed" to the terminal using the method learnt in the first post

System.out.println(speed);
we'll see "60" as output on the terminal, or BlueJ console.

2. Using double
double weight = 65.5;

Let's say weight is 65.5 kilos. To represent this in a java program you can declare a double variable and assign the value to it.

System.out.println(weight);
we'll see "65.5" as output on the terminal, or BlueJ console.

Tuesday, 12 November 2013

First Post

Hi, everyone! This is my first blogging experience. I will be using this blog to improve my blogging skills while sharing my programming skills. I'll start the tutorials from the very beginning and assume that people reading the blog have no programming background. My primary language is Java and I will start with it and see how it goes. Just a little heads-up, programming ways I show you here might not be the best ways of doing things but I'll be trying to stick to standard programming conventions. Without further ado we shall start our journey into the fascinating world of Java. Good luck! Also check out my friend's blog about scale models and hi-tech here Finally, have a look at my channel on youtube, I'm planning to upload some more video tutorials soon youtube video