Pages

June 06, 2015

Java Keywords and Objects Explained - Newbie Version (Part 2)

If you missed the previous one, click here for Part 1.


class
an object, the basic for Java
a Java program can have an infinite number of classes, and each class can communicate with each other, achieving whatever it is you intend to.


static
a keyword to denote something is to be compiled/created first, before anything else
this keyword can be applied to a class, a method, and a variable. Static objects doesn't need to be instantiated, and can be called immediately.


interface
a template for a Java class
why did I call it a template? A Java interface contains only method signatures and variables. It can be implemented by a Java class, and the class must contain the functions' actual code/implementation.


abstract
a keyword to denote something special
according to Java official tutorials, an abstract class cannot be instantiated, and may or may not have abstract methods. An abstract method is declared without an implementation, again according to Java official tutorial.


final
a keyword to make something a constant
anything declared as final becomes a constant, which means it may not be changed anytime, anywhere. This is useful when specifying hours in a day, days in a week, or anything you don't want to accidentally change later.


Do correct me if anything is incorrect or imprecise.

Thank you and stay tuned for the next part.

May 12, 2015

Java Keywords and Objects Explained - Newbie Version (Part 1)

Hello there.

Today I'll take a stab at explaining Java programming language keywords to you all.
As the title suggests, this explanation is aimed towards total newbies to Java, and probably also suitable for those having trouble understanding Java objects, especially to non-English speakers.

What made me start this series is simply because I had the same problem when i started programming, and I happen to start with Java, and not Python or C or other traditionally introductory language. At the time, there were a lot of explanations online, but because of my limited vocabulary of the English language, it took me longer to understand simple stuff.

I hope this series will help some understand Java faster.


variable
a name given to an object
As a non-native speaker, this was really confusing to me. It is actually very easy. Variables are like giving names to your cats. They all are cats, but with different names.


namespace
a name or path to specify location/collection of items
Yes, I realize namespace is not Java-exclusive, but anyone who wishes to start programming should know what a namespace is. A simple way to think of a namespace is it is sort of the drive letter in your computer. If you have C drive and D drive, you could also say you have C namespace and D namespace.


package
specifies what location/collection the current file is in
If I put package com.asrihashim.main
it means that the file is in folder com/asrihashim/main where com is a folder at my project's root


import
takes the specified file in a different folder to be used in current file
Since every .java file/class can call methods/functions in other .java file/class, import makes sure it knows where the Java file is located.
It also makes sure which class in Java SDK the file needs.


public
specifies the object to be accessible by anyone
When something is specified as public, it can be called by any Java class, no matter where it is called from


protected
specifies the object to be accessible by its subclass(es) only
Protected objects are only accessible by itself, and any subclass(es) extending the class it is in


private
specifies the object to be accessible by itself only
private objects are only accessible or can be called by itself, or simply in the class where it sits in only


Continue reading Part 2 here.

April 11, 2015

An attempt

It has been so long since I last posted.
I know I should come up with something good to make up for all the lost time, but this is the best I can do for now.
Too many things are happening right now, and I can't really discuss it here.

But, here is my stab at another Android app.
I designed it with hopes of it going viral, and looking at how the end product is,
it must go extremely viral, or it will just flop.

It is a very simple app. You click start, and continue answering questions until you get it wrong.
There is a lot like it, so this post would be the kind of promotion it heavily relies on.

So go check it out via the link below, and I'll come back later, hopefully with something better to say.

3-Second Maths Quiz