Saturday, March 25, 2017
Simple Program in Java that Reverses a String
So I decided to code a simple program today in Java because my laptop is down and I cannot access Visual Studio to program in C#, which is the language I'm used to.
The program reverses any string you input and displays it backwards.
I discovered something that Java doesn't have which C# does. C# treats a string as an array but Java doesn't. So in line 34, in C#, I could've typed "words[i] = str[count];". Which is syntactic sugar compared to Java. Yet C# is considered more complex than Java which you can read about in this link. Since I'm a novice in Java and have been groomed in C#, I guess I WOULD find C# must easier.
Below is my code. Please comment if you have an easier way to code this.
Subscribe to:
Post Comments (Atom)
How to Access the Metaverse
In February this year, Bernard Marr predicted that "in 2022, we'll see new, lighter, more portable VR devices, so instead of having...

-
In light of a book I've been working on, which you can read about here , I thought I might do a bit of digging on brain-computer interfa...
-
In February this year, Bernard Marr predicted that "in 2022, we'll see new, lighter, more portable VR devices, so instead of having...
-
Artificial Intelligence (AI) is slowly developing at the moment because, as John Light infers (2017), it is both a technology AND a philosop...
No comments:
Post a Comment