Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. ///http://www.sanosay.org/courses/oop/lectures/misc/
  2.  
  3. public class MyName{
  4. public static void main(String[] args){
  5. // Set the name
  6. String name = "Dimitris";
  7. /**
  8. Set the surname and the age
  9. */
  10. String surname = "Diamantis";
  11. int age = -1;
  12. // print out the data
  13. System.out.println("My name is: "+name +" "+surname);
  14. System.out.println("And my age is: "+age);
  15.  
  16. }
  17.  
  18.  
  19. }
  20.  
  21. public class Operations{
  22. public static void main(String[] args){
  23. double x=5;
  24. double y; /// int y = 0;
  25. y = 10;
  26. y+=1;
  27. y++;
  28. y = y+1;
  29. y = 9;
  30. double z = x/y;
  31. boolean a = true;
  32. boolean b = false;
  33. String hello = "world";
  34. hello = "Hello " + hello +" "+ z;
  35. System.out.println(hello);
  36. System.out.println(x+y);
  37. System.out.println(x*y);
  38. System.out.println(x-y);
  39. System.out.println(z);
  40.  
  41. }
  42.  
  43. }
  44. public class Main{
  45. public static void main(String[] args){
  46. System.out.println(" *");
  47. System.out.println(" ***");
  48. System.out.println(" *****");
  49. System.out.println(" *");
  50. }
  51.  
  52. }
  53. public class Main{
  54. public static void main(String[] args){
  55. System.out.println("Hello world!!!");
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement