Advertisement
MrDoyle

Untitled

Aug 18th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. public class Main {
  2.  
  3. public static void main(String[] args) {
  4. //This program is showing the different variable types
  5.  
  6. //Printing to screen
  7. System.out.println("My name is Mr Doyle");
  8.  
  9. //Printing a number
  10. System.out.println(56);
  11.  
  12. //Printing a Boolean
  13. System.out.println(true);
  14.  
  15. //Printing a character
  16. System.out.println('@');
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. int myAge = 35;
  29. String name = "Mr Spongebob Doyle";
  30. Boolean test = true;
  31.  
  32.  
  33. System.out.println("string");
  34. System.out.println(345);
  35. System.out.println('@');
  36. System.out.println(true);
  37. System.out.println(myAge);
  38. System.out.println("My name is:" + name);
  39. System.out.println(test);
  40.  
  41. myAge = 5000000;
  42.  
  43. System.out.println(myAge);
  44. System.out.println(myAge);
  45.  
  46. System.out.println(7+7);
  47. System.out.println("7+7");
  48.  
  49. int num1 = 15;
  50. int num2 = 17;
  51. System.out.println(num1 + num2);
  52.  
  53. System.out.println("My name is: " + name);
  54.  
  55. System.out.println(19 / 8);
  56. System.out.println(19 % 8);
  57.  
  58. System.out.println(5>7);
  59.  
  60. System.out.println(5==5);
  61. System.out.println(5<=5);
  62.  
  63. System.out.println("I am checking if 6 is not equal to 8: " + (6!=8));
  64.  
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement