Ads

Your Ad Here

Tuesday, February 28, 2012

Basic Java Program: Hello World!

In this section, I will discuss how to make a simple Hello World! program. First, open your Eclipse, create a new Java Project, and then create a class into it and name it helloprog(or anything that you want).  And then copy these codes, and run/debug it.


 Input:


class helloprog //change the helloprog with what you named on your class
{
    public static void main(String args[])
    {
        System.out.println("Hello World!");

        System.out.println("Welcome to CJ's Blog Spot :)");
    }
}



When you saw what is on the output of the program, I want you to compare it with the codes and try to examine it.

Here is the output if you don't have Eclipse:


Output:
Hello World!
Welcome to CJ's Blog Spot :)


   I think you have some concept now of what did happened to the output of the program. Now, I'm going to explain to you on my own understanding of how did it happened.

1.) 
class helloprog
{
    ........
    ........
}


   The first line of the program which is  class helloprog, is the class definition of our program. It indicates the name of the class which is helloprog. But you can name your class anything that you want. In Eclipse, when you create a class, the class automatically appears with the name you put into it. 
    Well, a class is the basic unit of a Java Program and it can have one or more methods. It's very important that you have a class because you can't run the program without it. By the way, I will explain more about classes on the next Basic Java Program Lesson.
    The second line of the program which consists of the left brace, and which is matched with the second right brace which is at the final line of the program indicates the beginning and end of the body of class.

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

    ........
    ........
    }
}
   
    The third line consists of public static void main(String args[]),and this is the method header of the class. Well, I only understand few about this code but I know that it is very important. As you can see, the method is named main and what it means is that it's gonna be our main method.
    Well, every Java Class must have a main method and it must only be one. It's very important because when you run a program, your computer will always going to find first and begin the execution with the main method. So if you don't have this method to your program, your computer wouldn't know where to begin the execution of your program.
    Now, we created this method because we want it to print the Hello World!.

3.)
class helloprog
{
    public static void main(String args[])
    {
        System.out.println("Hello World!");

        System.out.println("Welcome to CJ's Blog Spot :)");
    }
}

 On the fifth line of the program, or after the first/left brace of the main method, you can see the method body, and this is where our instruction for the method is located. As you can see, everything that is inside the parentheses of the System.out.print(....);  was printed on the output. 
    Well, the reason behind that is the print or println(next line) method. It is a built-in method which prints what you have inserted inside the parentheses. As you can see also, we entered a double quotation marks inside the parentheses but it is not printed. Well, it's because everything that was inside the double quotation marks means that it's a String. A String evaluates to itself, that's why the values are the String itself. But if there's no quotation marks there, the computer will not print what is inside the parentheses(unless it is a number because it's going to be an integer). 
    By the way, I'm just going explain to you more about of what is a String, Integer and Character later .The important now is you know what is a class, main method, and how to construct a simple Hello World! program in Java.(YEAH!) :)



Well, that's for now, I hope you understand what did I say.
If there's something that is not clear for you or if there's something wrong, don't hesistate to leave a comment down below or email me. Thanks :)

Sunday, February 26, 2012

Pilgrimage.

Last February 25, 2012, some students of our school, including me(YEAH!), had a Pilgrimage the whole day.  Well, if you don't know what Pilgrimage is, it is where you visit and offer prayers or some rituals for some important place/s  within your faith or religion. It's a trip or  journey where you have a good purpose, it's because you want to have a deeper understanding and new insights about your faith. And well, we visited different churches from Manila, Bulacan and Pampanga.


Well, I was very exhausted that day but the good part of it was that it was for good and for God. I sacrificed my whole day offering prayers,reflecting and giving thanks for God and the churches that we had visited. This day was just so cool, I really enjoyed it a lot. I thanked God that he allowed me to join this pilgrimage. :)

Here are some photos from the churches that we had visited.Some photos are kinda blurry because I'm only just using my iPhone and my father didn't allow me to bring his camera. By the way, I just want to share with you how beautiful and unique these churches are. So take a look.




Shrine of Jesus Church
This is the first church that we visited. It was located at Central Business Park (beside SM Mall of Asia), Reclamation Area. 



 
This is the altar of the Shrine of Jesus Church.





San Agustin Church
This church was located inside the historic walled city of Intramuros in Manila. This was my favorite church that we had visited. It's because of its beautiful and amazing design and architecture. I also learned a lot of stuff in the museum of the church.And now, I'm still amazed at this church and I will not forgot what I had seen and learned to this church. I felt like I went back to the Spanish Colonial Era.




This is the altar of the San Agustin Church.



Look at this amazing 3-D paintings at the ceiling of the church.

 


The Pipe Organ of the San Agustin Church





National Shrine of the Divine Mercy
This is a sacred shrine dedicated for the Divine Mercy. It was located in Marilao, Bulacan. It has became one of the famous shrine in the Philippines due to its numerous cases of healings and conversions.That's why this shrine has so many visitors,pilgrims and devotees.






























The altar of the National Shrine of the Divine Mercy Church.




























This was inside the Lourdes' Cave. It was believed that this water could heal some illness.



























These crutches are belonged from the devotees who are healed by the shrine.



Our Lady of Immaculate Conception of Malolos
This was the fourth church that we had visited. It was known as the Malolos Cathedral or the Minor Basilica of Our Lady of Immaculate Conception in English and Basilica Minore dela Nuestra SeƱora de Inmaculada Concepcion in Spanish. It was located at Malolos City, Bulacan. 



The altar of the Our Lady of Immaculate Conception Church.  



  

Barosoain Church
It was located at Malolos City, Bulacan. As you can see from its look, it was one of the most oldest churches here in the Philippines. It earned the title as the Cradle of Democracy in the East and the Site of the First Philippine Republic.It was also the most famous and important church in all Filipinos because of some important events that happened to it. You can see it also from the old Ten Pesos and new Two Hundres Pesos paper money.

Well, I forgot to take shots inside the church because we leave immidiately after discussing the history of the church and praying for it. By the way, the church was also still beautiful and strong despite of its oldness. And for this moment, I believed now that some old buildings and structures are more durable than new ones.



 St. James the Apostle Church
This church was located at Betis, Guagua, Pampanga. The church was very peaceful and calm but it's a very popular church here on Guagua, Pampanga because it's also one of the most oldest church on Pampanga region. I also forgot to take shots inside it because of the same reason from what had happened at the Barosoain Church.






Thanks for reading! 
:)



Friday, February 24, 2012

Introduction: Downloading and Installing JDK and Eclipse

 Before doing your program and constructing codes, you need to download first the JDK and Eclipse, instead of doing it in notepad.

JDK or Java Development Kit is a SDK or Software Development Kit used for creating Java Programs. So basically, it compiles the code that you have written and display the output of it. That's why it's very important that you have this before creating Java programs. Click for these links and watch the video to know more about JDK and how to download and install.
http://www.youtube.com/watch?v=Hl-zzrqQoSE 
or
http://www.oracle.com/technetwork/java/javase/downloads/index.html


Eclipse IDE is a text-editor program especially created for Java Programs where you write your codes especially if you are compiling many codes or programs, instead of writing it on a Notepad. Click for these links and watch the video to know more about Eclipse and how to download and install it.
http://www.youtube.com/watch?v=CE8UIbb_4iM&feature=relmfu
or
http://www.eclipse.org/downloads/


NOTE:
You need to download or you need to have JDK first before running Eclipse.





REMINDER!!

So first of all, I want you to know that I'm only a student and I'm still studying how to program well.This is only for beginners. So if you're a Java Developer and If I mentioned something wrong with what I'm writing here, please correct me or contact me immediately. I just want to share what I have learned in school and I want to explore more around the programming world. And I want to learn also from you because you might know something that I didn't know or correct me for what are my mistakes. By the way, JAVA is the first programming language that our professors start with. We're not still finish with it and we're still on the basics because I'm still a College Freshman(So goodluck for me). :)


Thanks!:) 

Thursday, February 23, 2012

Listening to music while Studying?

I chose this topic because there's so many students that I always saw listening to music while studying their lessons. One of my friends and also my sister, can't review well if they don't listen to music. I don't know if they're just bored of studying, but they still got good grades. So a question just popped up in my mind:

Is it good or bad?
Does it improve our mental process?

Well,that's why I became very interested in this topic because I really don't listen to music while studying. Because I found it very irritating and I distracting. So to answer to my questions, I need to try it.(Seriously, I try it although I hate it.)


So while I'm on the jeepney, going to school and studying a lesson for a quiz, I simply grabbed my earphone,plugged it in my phone and listen to some music. Well, I decided to do it on the jeepney because the passengers are very noisy so I can't focused well.So I listen for some acoustic songs for a while. Well, everything was just fine that moment and I can focused on what I'm studying, and I don't know why,but I think it's because I only hear slightly the passengers(just like whispering). But when I change the music for punk rock songs, my life goes miserable again-_-. I can't understand everything that I'm reading and I'm more focused on the music, because my hands were strumming just like I'm holding a guitar(YEAH!) and my foot was stamping(YEAH!),and felt like I became a rockstar that moment(YEAH! WannaBe). So I change it to acoustic song again before everything that I studied will be lost.

By the way the result of the quiz was just okay but some of what I have reviewed was on the far.. far.. far.. far away , deep.. deep.. place on my mind. But I really still prefer to study in a silent place, because I'm more comfortable with it. But if there's a music, I prefer to listen to Classical Music or any soft and relaxing music with no lyrics. Not that I'm saying acoustic songs were not a good song when studying, but there's just something on me that I found lyrics very irritating when studying. But what happens in the jeep was that I can't hear so much of the lyrics because the equalizer of my phone was set on "Vocal Reducer" that's why everything that I've heard was only the guitar or piano.

Well, it's just for me, because I know that every person has it's own comfort zone(am I right with this?^^) or anything that keeps them on the track. Some people likes to study when they are watching television or while listening to music and some wants to study on a silent place.So it's really up to you, just make sure that you understand what you're studying.:)

By the way I tried to read this article, "Should you listen to music while studying", and it's about this topic too. I think you should try to read it too if you're just like me, wondering.Hope it helps yah!!:)


Thanks for reading.




Tuesday, February 21, 2012

Call It What You Want.

Hey guys! I think you're wondering what was the title all about, well it is about a song of the band Foster the People from their album Torches. I thought about reviewing it not just because it has catchy tune and good melody but because of its meaningful,well-written and beautiful lyrics.
Well, If you could listen to the song, the lyrics is all about of how we live our lives with lies. (Lies? what lies? ) Example of this is when your friends are famous and rich, so in order to be their friends you pretent to be rich and famous. But the truth is you're not rich and famous, you only live in a simple house with a simple life. And yeah, some of us are always just like that.That's why we just go with the flow, live our lives with the way other people thinks of us and hide what we really are. And well, that sucks.

That's why we need to change the way we live like this and listen to this song(if you only want). We need to understand that  it's normal and it's very common to every people to judge us these days with the way they see us.  The truth is people are always judging each other and, the truth is, they're not very good at it. Don't put a lot of concern into what people think of you. You weren't created to please and entertain everyone. You were created to be you, so feel good about yourself. 

I know it's hard to change the way we live like this because we're afraid that those PERFECT PERSON judge us if we commit mistakes or something might happen wrong(just like being bullied,being kick-out of the group). Ehem ,well, there's no perfect person in this world except from God. Just let them judge you but at least you're better than them because you know you're living your life to the fullest and what it is to be.

So stand up and show what you really are. Dance if you like to dance, sing if you want to sing. Take a break and have fun. The world is free. Ignore what those people are going to think of you because those people don't really know and just hide who they really are that's why they just judge other person instead of theirselves.  Just like from the lyrics

"You're ducking and moving 
Just to hide your bruises from all your enemies 
And I'm in the crossfire dodging bullets
From your expectancies..

We've got nothing to lose 
You better run and hide 
Yeah you've crossed the line 
I've got a knife behind my back (just sayin') 
We've got nothing to prove 
Your social guides give you swollen eyes 
But what I've got can't be bought so you can just "


And as it said, we've got nothing to lose and nothing to prove. We just need to live our lives in the proper way and that is by being WHO WE REALLY ARE.And there's no bad thing about that. You're created by God unique.

and shout "CALL IT WHAT YOU WANT!"

:) 



By the way, sorry if some of my grammar is wrong. hek hek