Learn Java Tutorial for Beginners (Video), Part 3: Strings

In the third part of the Java tutorial for beginners video series, we look at working with text using the String class. We also get our first real peek at using classes and objects.



Code for this tutorial:

 

public class Application {
    public static void main(String[] args) {
        
        int myInt = 7;
        
        String text = "Hello";
        
        String blank = " ";
        
        String name = "Bob";
        
        String greeting = text + blank + name;
        
        System.out.println(greeting);
        
        System.out.println("Hello" + " " + "Bob");
        
        System.out.println("My integer is: " + myInt);
        
        double myDouble = 7.8;
        
        System.out.println("My number is: " + myDouble + ".");
    }
}


 
Hello Bob
Hello Bob
My integer is: 7
My number is: 7.8.