Showing posts with label tutorials. Show all posts
Showing posts with label tutorials. Show all posts
Monday, October 24, 2011 3 comments

WALKTHROUGH:TNB Java Tut 42 -"toString" [VIDEO] [SOURCE CODE]

This is a full walk-through of Java Tutorial 42 by TheNewBoston. Each walk-through includes:
  • Embedded Video Tutorial
  • Text Transcript of the tutorial broken down into steps.
  • Source code
  • Visual Breakdown of the code
In this walk-through you will learn about using the "toString" method, a very useful method used to give any object a default string representation.


Step 1.Create a class and name it "stringDinger"
 public class stringDinger {  
 }  
inside of the "stringDinger" class:

Step 2.Create 3 int vars(month, day, year)
  private int month;  
  private int day;  
  private int year;  

Step 3.Create a constructor for the "stringDinger" class that accepts 3 parameters.
 public stringDinger(int m,int d,int y){  
inside of the stringDinger constructor:

Step 4.Set each of the incoming parameters to their corresponding variables:
  month=m;  
   day=d;  
   year=y;  

Step 5.create a print function statement that prints the sentence "the constructor for this is %s\n , this"(note: "using "this" in this case will equal whatever you're "toString" method returns )
  System.out.printf("the constructor for this is %s\n",this);  
end of stringDinger constructor.

Step 6.Create a "toString" method that returns the variables formated like this : "month/day/year":
  public String toString(){  
   return String.format("%d/%d/%d",month,day,year);  
  }  
end of "stringDinger" class

Step 7.Create a new class with a main method, name the class "useTheDinger"
 class useTheDinger{  
  public static void main(String[] args){  
 }  
 }  
inside the  main method of the "useTheDinger" class:

Step 8.Create a stringDinger object with the parameters 4,5,2011
  stringDinger theDingerSpeaks = new stringDinger(4,5,6);  

End of Tutorial
 TNB Java Tut 46 Complete Source Code 


"stringDinger" Class

 public class stringDinger {  
  private int month;  
  private int day;  
  private int year;  
  public stringDinger(int m,int d,int y){  
   month=m;  
   day=d;  
   year=y;  
   System.out.printf("the constructor for this is %s\n",this);  
 }  
  public String toString(){  
   return String.format("%d/%d/%d",month,day,year);  
  }  
 }  

"useTheDinger" Class

 class useTheDinger{  
  public static void main(String[] args){  
   stringDinger theDingerSpeaks = new stringDinger(4,5,6);  
   System.out.println(theDingerSpeaks.toString());  
  }  
 }  

Tuesday, October 11, 2011 0 comments

CHALLENGE:Java Tut 32-34-Arrays in Methods & Multidimensional Arrays

The following is a challenge for new developers that have completed:
 Java Tutorial's 32-34 by theNewBoston. To get the most out of these challenges try them a few hours or the day after watching/following along with the actual video.
 


B.A.M.F Challenge:
B.A.M.F Challenges & why you want to always at leas try them explained Here:http://bit.ly/ogivqe
Difficulty: 1/2
 Create a java console program with a method that accepts a multidimensional array in its parameters.When the method is called it should print the array out to the console as a table.If you've done everything right you're results should look like this:


This is the the Multi Array
8        9        5          12
55      12        32         22
15       4        39         83




CHALLENGE!!
(Before starting any of the challenges always declare a class and a main method unless told otherwise)
 Difficulty:★2/3
1.Create a multidimensional array. It should have at least 3 arrays inside of it and each array should have several values.

2.Create a method that accepts a multidimensional array in its parameters, name the array in the parameters "x" and name the method "display"[

3.Inside the display method create a for loop, name you're counter "row; loop  through until x.length is less than "row" ; increment by 1

Inside of the "row" for loop insert: [

  • Another for loop. name you're counter "column"; loop  through until x.length is less than "x[row].length;increment by 1. Inside the "column" for loop insert:


  •    1.A print line statement that prints  x[row][column] + "\t"]

  • Print line statement that prints: a blank line] ]


    • 4.In the main method write a print line statement that reads "This is the array table"

      5.In the main method call the display method and place you're array in the parameters

      Note: I am trying to experiment to find the best way to explain loops in words. Everything that is Orange is inside of the "Row" for loop and everything that is red is inside the "column" for loop. If this made it easier for you to understand or you have some suggestions to improve these challenges leave it in a comment below!!


      COMPILE & PRAY TO DUKE!!!
      View the video tutorial: http://bit.ly/r9jFZN
      Monday, October 10, 2011 1 comments

      WALKTHROUGH:TNB Java Tut 26-Random Number Generator[VIDEO & SOURCE CODE]]

      This is a full walkthrough of Java Tutorial 26 by TheNewBoston. Each walkthrough includes:
      • Embedded Video Tutorial
      • Text Transcript of the tutorial broken down into steps.
      • Source code
      If you found this walkthrough helpful and want to see more of them please leave a comment and let me know.Im trying alot of new things and still trying to get a feel for what people want more of.You're feedback counts around here!!!



      Step 1.Import the Random package
       import java.util.Random;  
      

      Step 2. Declare a new Random variable and name it "dice"
       Random dice=new Random();  
      

      Step 3. Declare a int variable and name it "number"
       int number;  
      

      Step 4. Create a "for" loop that will loop through 10 times before stopping.

       for(int counter =0;counter<10;counter++){  
       }  
      

      Step 5. Inside the for loop:
      • Set the number var to equal a random number between 1-6
      •   number=1+dice.nextInt(6);  
        
      •  Print the random number variable + a space (" ")
      •   System.out.println(number +" ");  
        
      End of Tutorial

       TNB Java Tut 26 Complete Source Code 

       import java.util.Random;  
       class TNBjtut26{  
        public static void main(String[] args){  
       Random dice=new Random();  
       int number;  
       for(int counter =0;counter<10;counter++){  
        number=1+dice.nextInt(6);  
        System.out.println(number +" ");  
       }  
          }  
       }  
      
      4 comments

      Android API Demo - The Best Developer Resource No One Told You About

               Have you ever just wanted a working example of every single little component in Android you can dissect? Yeah, me too. Turns out it exists....and no one told you about it.Shame on every developer/tutorial writer that dint mention these repeatedly to me while I was learning.
              As long as your SDK is all up to date just boot up your emulator , check your app drawer and look for a app called "API Demo" from there you have a working demo of almost every android component you could ever ask for.

      Want to play with the code? YOU CAN!!!
      Best part is you not only can play with live demos of all this stuff you can actually dissect it too!! Just check out this link and click around till you reach the demo source your looking for.

      Android API Demo's:http://bit.ly/pw8TGA  

      If you found this post helpful and you want me to keep working like a asian kid in math class to bring you the best Android resources consistently click clack that comment button below and leave me ur opinion or follow the blog!!! It lets me know
      you care :)
      0 comments

      CHALLENGE:Java Tut 29-Summing Elements of Arrays by theNewBoston

      The following is a challenge for new developers that have completed:
       Java Tutorial - 29 Summing Elements of Arrays by theNewBoston
       


      B.A.M.F Challenge:
      B.A.M.F Challenges & why you want to always at leas try them explained Here:http://bit.ly/ogivqe
      Difficulty: 1/2
       Create a java console program that stores 8 numbers between 1-100 in a array and then find the sum of all the numbers combined using a for loop.


      CHALLENGE!!
      (Before starting any of the challenges always declare a class and a main method unless told otherwise)
      Difficulty:
      1.Create a int array that stores 8 int's and name it values
      2.Create a int var and name it sum
      3.Create a for loop , set the counter to 0 to start, continue looping as long as the counter is less than the length of you're int array, increment the counter by 1 each time it loops.Each time it loops it should:
                    * sum+= values[counter]  (sorry guys , couldn't think of a way to explain that part in words)

      4.Print the sum.

      COMPILE & PRAY TO DUKE The Java God!!!!

      View the video tutorial: http://bit.ly/o7iT9P 

      0 comments

      CHALLENGE:Java Tut's 27&28-Intro to Arrays

      The following is a challenge and or walk-through for new developers that have completed:
      Java Tutorial - 27&28 -Introduction to Arrays by theNewBoston
      To get the most out of these challenges try them a few hours or the day after watching/following along with the actual video.
       


      B.A.M.F Challenge:
      B.A.M.F Challenges & why you want to always at leas try them explained Here:http://bit.ly/ogivqe
      Difficulty: ★ 1/2
       Create a int array and loop through each entry in a 2 column list .You're results should look like this:

      Index     Value
      0              18
      1               24
      2                 8
      ect....
      _________________________________________________________________________________

      CHALLENGE!!
      (Before starting any of the challenges always declare a class and a main method unless told otherwise)
       Difficulty:
      1.Create a int array with 5 values of you're choosing.
      2.Create a print line statement with the words Index , a few spaces and Values ( like the example in the BAMF challenge above.
      3.Create a for loop that will continue to loop until you're counter is greater than the length of the array you created , increment by one. Each time it loops:
                          * Print the Index & Value (hint: use the counter from you're for loop)

      View the video tutorial: http://bit.ly/omhcMV 



      If this tutorial was helpful for you or you have suggestions as to how I can improve this series please leave a comment below, You're voice will be heard and I will make what ever improvements I can.

      Friday, October 7, 2011 0 comments

      CHALLENGE:Java Tut 26-Random Number Generator

      The following is a challenge for new developers that have completed:
      Intermediate Java Tutorial - 26 -Random Number Generator by theNewBoston
       


      B.A.M.F Challenge:
      B.A.M.F Challenges & why you want to always at leas try them explained Here:http://bit.ly/ogivqe
      Difficulty: ★ 1/2
       Create a java console program that simulates rolling  a standard 6 sided die(the single form of dice)  10 times and print out the results in the console with a space. The results should look something like this:  
      3 7 2 2 1 ect... up  to 10


      CHALLENGE!!
      (Before starting any of the challenges always declare a class and a main method unless told otherwise)
       Difficulty:
      1. Declare a new Random variable and name it "dice"
      2. Declare a int variable and name it "number"
      3. Create a "for" loop that will loop through 10 times before stopping.
                (hint: initialization; termination; increment
      4. Inside the for loop set the number var to equal a random number between 1-6(hint: "dice.")
      5.Print the random number variable + a space (" ")
      ( If you dont add the space when you run it all youre numbers will be in one jumbled line.)

      View the video tutorial: http://bit.ly/pLAzeg
      0 comments

      Introducing B.A.M.F Challenges

       (B.A.M.F's Make Money Like George Jung From Blow and you will to once you master the art of I2J Translation)

      B.A.M.F Challenges are for those of you feeling a little cocky, Instead of giving you step by step directions I will only give you a abstract goal of the challenge and its up to you to figure out how to make it happen.Even if you cant always complete the B.A.M.F challenge, you should always at least try and then move down to the reg challenge if youre struggling.B.A.M.F Challenges help youre brain become what I call a Java "translator" , as in you can listen to a client explain something they want done in simple English and convert it in you're mind to rough Java.Almost every new programmer gets to a point where they can read source code and understand what its doing, but struggle with creating a program from a idea alone without help or alot of research.The end results should still be the same as the regular challenge.
      0 comments

      IM BACK!!!


      (The best image I could find to represent ADHD)

      I started this blog and being the ADHD developer I am I got distracted and kinda abandoned it for a while but, I checked my blog views for the first time today and realized that this blog is still getting daily views, comments and followers a month after I abandoned it. That tells me that there is a serious demand for a blog like this so ive decided to get back at it!!! If you stumble across this blog and you want me to keep going leave me a comment, follow it , link to it...anything to show me that im not doing all this work for nothing.


      New Java challenges coming soon!!!
      Sunday, July 10, 2011 606 comments

      Top 5 Resources for Learning Java for Android



      Learning to make Android apps is alot like saying " I wanna learn how to write novels in Spanish"  You cant just start writing novels in Spanish if Spanish  isn't your primary language. First you learn the language(java) then after alot of practice you start to catch on to the grammar(syntax) and start to make connections and form sentences. Finally you start to see the big picture of the language and with time your able to write with some sense of style so you can finally write that Spanish novel.(your Android app)

      We dont ask for donations but, if you found this post helpful and want to see more please give +k in Java or Android Via: http://klout.com/Fresh83

      Learning java for Android can seem overwhelming . You have to learn this completely foreign language before you can even start to get to the good stuff(working on apps) not only that but, the java language is HUGE!!! Where do you start? What do you need to know? whats irrelevant to you as a android developer?Below are 5 of my favorite resources for building a strong foundation in java.

      I.Programming Methodology- Stanford



      If your new to Java or development in general this is a priceless web gem.I would dare to say that Mehran Sahami is the best professor ive ever learned from. You can tell the man puts real work into his lessons and does all he can to make java more interesting than it really is. The course is great because it requires no prerequisite programming skills but, does require some level of patience(there is around 30 hours of content from start to finish separated into hour long lectures.It may not be the quickest way to learn java overnight but, your getting something more than someone telling you to cut this and paste this. Its called programming methodology because its aimed to teach you the top down mindset of a developer from the start.The entire course is online via youtube and also comes complete with full class documentation and homework assignments(dont skip them , they may be challenging, but you will thank me after you complete them.




      II.MobileTutsPlus-Learning Java for Android



      If you have development experience in another language and just need a crash course in the java for android this is the tutorial series for you. This series gets right to the meat and potato's with little to no filler.Another thing I really like about this tut series is it mixes in what they call "challenges" where they ask you to do something based on what youve learned in the previous tutorials without just giving you the answer. This is great because it makes what your reading stick to you.





      Ahh the good ol' java trails . Java trails aim to be the master resource for learning java by oracle(the company that owns java) Thinking back what really stuck to me from these tutorials was a overall understanding of OOP. There is literally 1000s of pages on literally everything you could ever want to know about java around here but, in my personal opinion they can be a little dry. Its a good tutorial series to have bookmarked if you want to learn about something specific but, I wouldn't spend weeks trying to read over them from start to finish. There is not enough actual tutorials and things will start to blend together in your mind if your not actually practicing what your learning about.




      IV.Head First Java-Java for the right brained ADHD Developer 



      Head first is a unique book series that accounts for the way the human brain learns best. The books are easy to read and packed with humor, pictures and analogy's that make sense to those of us who don't think in 1's and 0's naturally.The downside is this is not a free series unless your lucky enough to know a pirate....and did i mention torrents are illegal ( I hope someone got that)







      If youve typed in "Java Tutorials" on youtube you've probably heard my boy Bucky keeping it real and spitting knowledge to all you java newbs out there.This guy is Java Juggernaut. His beginner series alone has 87 videos and there all quality. If that wasn't enough he also did a intermediate series that probably has another 80(I haven't finished them all yet myself) This guy has the learning java via youtube market under lock and key and hes one guy doing this stuff from home!!! His tutorials are short(very few exceeding 10 minutes), sweet and casual which makes them easy on the ears.I give big props to this guy and you should to.If you watch 10 or more of these tutorials I would highly recommend donating a few buck's to encourage people to do stuff like this out of the kindness of there hearts.


       
      ;