From 73eb983bde9f50baf9e7bd93adc4b8ad7a643822 Mon Sep 17 00:00:00 2001 From: Carlos Patino Date: Fri, 1 Oct 2021 11:28:13 +0100 Subject: [PATCH] fixing bubblesort to be more explicit and using java extension instead of txt --- JAVA/HelloRecursively.java | 15 +++++++++++++++ JAVA/{bubble.java.txt => bubble.java} | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 JAVA/HelloRecursively.java rename JAVA/{bubble.java.txt => bubble.java} (90%) diff --git a/JAVA/HelloRecursively.java b/JAVA/HelloRecursively.java new file mode 100644 index 0000000..2372fac --- /dev/null +++ b/JAVA/HelloRecursively.java @@ -0,0 +1,15 @@ +public class HelloRecursively { + private void hello(int n) { + System.out.println(n); + if (n < 1) { + System.out.println("End"); + } else { + hello(n-1); + } + } + + public static void main(String[] args) { + HelloRecursively hr = new HelloRecursively(); + hr.hello(200); + } +} diff --git a/JAVA/bubble.java.txt b/JAVA/bubble.java similarity index 90% rename from JAVA/bubble.java.txt rename to JAVA/bubble.java index 1f2f58b..8de5c81 100644 --- a/JAVA/bubble.java.txt +++ b/JAVA/bubble.java @@ -10,7 +10,7 @@ public static void main(String[] args) System.out.print("\n Enter Size of Array\n"); n=sc.nextInt(); int [] a=new int[n]; - System.out.print("GIVE NUMBERS FOR ARRAY :"); + System.out.print("GIVE NUMBERS FOR ARRAY (separated by spaces):"); for( int i=0;i<=n-1;i++) { a[i]=sc.nextInt();