Film izle Sinema izle Bayan Azdirici Bayan Azdirici Damla Azdirici Geciktirici Sprey Geciktirici porno sex travesti cialis kiz oyunlari kiz oyunu oyna porno sex porn sex r57.txt c99 shell hackerbox



Software

October 29, 2010

Train with a Trainee: Week 2 Part D, Return

Return 2

Hey everyone, I hope we are all doing well. Yesterday we learned what a method was. The best part was that it wasn’t painful at all since we have been using them for a week already. We have just now put a name to them. After that we took a look at how to use return in a method to return something from the object. We will continue on with that here with another example of how to implement a return.

No one seemed to have any issues in the last post with screen shots and highlights instead of entire code. Continuing on in that style we will highlight what we add since we are still working in all the same code. Let’s get started.

The first new lines we are going to add will be another set of public ints which will tell Java that something will be a number. In this case, length and width will be numbers. Go ahead and add these lines.

public int length;
public int width;

Then we need to move down and and give the length and width a value:

length = 10;
width = 5;

Now we have given our public int length and width a value to reference. Now we need to make it do something. So let’s move down a little further and give the return something to to do so that it will return something using our new length and width values.

return length*width;


With those five lines of code we now have a return that will give us the length*width of the book. If you remember from past articles the * means multiply. When we run this application, our OUTPUT window will display:


As always, play around with different configurations, sizes, numbers, words. Make it your own.

Happy coding everyone.














About the Author

Stormy Beach
I worked at T-Mobile for 5 years. I was the go to guy for Android phones and training. That passion didn't stop even after my departure from the company. I currently moved up from my MyTouch 3G to a Samsung Vibrant. A lot has changed in a very short time. I look forward to all the latest and greatest every time I wake up.





 
 

 
Final-Comp_2

[Tutorial] Adamoid Fast and Easy Theming

Among the many customizations available for the various amounts of Android devices, themes are probably one of the biggest. There’s no better way to express yourself than a completely custom interpretation  of what you t...
by Jacob Cunningham
0

 
 
Android-x86

HOWTO: Install Android-x86 2.2 in VirtualBox

Since Android-x86 2.2 was officially released a few days ago, I figured I’d provide a quick rundown of how to get it up and running in VirtualBox. All in all, it is pretty straightforward. Download, install, download, ins...
by Randall A. Gordon
43

 
 
return1

Train with a Trainee: Week 2 Part C, Methods And Return

Here is where we left off. We created a Class (book.java) then we created a book object inside (Store.java). Then we took the Object (book1) in the Store.java file and invoked it inside the book.java file. So the Main class (bo...
by Stormy Beach
1

 

 
Store

Train with a Trainee: Week 2 Part B, Classes and Objects

I hope everyone was able to get through Part A without any trouble. Of course, as I mentioned before, what we just went through and created won’t do anything yet. That is where Part B comes in. Don’t worry it won...
by Stormy Beach
3

 
 
Loops1

Train with a Trainee: Week 1 Part G, Loops

First and foremost, and I can’t stress this enough, I am not a developer. I want to be though and that’s what counts. If any of the information provided in this 12 week series is incorrect or can be made simpler, please let...
by Stormy Beach
0

 
 
Switch case 1

Train With A Trainee: Week 1 Part F, Switch Cases

In the last 3 lessons we went through 3 basic codes that gave a print out on your OUTPUT window using variables and conditionals. We can move on now to using Switch Cases. What is a switch case?  A switch case is used when the...
by Stormy Beach
1

 




One Comment


  1. rikin

    hey i want to learn android..
    where i can find 3rd week parts..
    rply ne soon..
    thnx..



Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 
sexsikislezbiyensex izledeutschsex.netdeutschporno.net sexpornoporn videoshd sexsex free pornfree Porn videos
kiz oyunlari kiz oyunu oyna porno sex porn sex porno