Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- //This program is showing the different variable types
- //Printing to screen
- System.out.println("My name is Mr Doyle");
- //Printing a number
- System.out.println(56);
- //Printing a Boolean
- System.out.println(true);
- //Printing a character
- System.out.println('@');
- int myAge = 35;
- String name = "Mr Spongebob Doyle";
- Boolean test = true;
- System.out.println("string");
- System.out.println(345);
- System.out.println('@');
- System.out.println(true);
- System.out.println(myAge);
- System.out.println("My name is:" + name);
- System.out.println(test);
- myAge = 5000000;
- System.out.println(myAge);
- System.out.println(myAge);
- System.out.println(7+7);
- System.out.println("7+7");
- int num1 = 15;
- int num2 = 17;
- System.out.println(num1 + num2);
- System.out.println("My name is: " + name);
- System.out.println(19 / 8);
- System.out.println(19 % 8);
- System.out.println(5>7);
- System.out.println(5==5);
- System.out.println(5<=5);
- System.out.println("I am checking if 6 is not equal to 8: " + (6!=8));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement