From f66f24dd73378eefbd3d695aac98565024babfcf Mon Sep 17 00:00:00 2001 From: SensehacK Date: Thu, 8 Aug 2024 10:22:15 -0600 Subject: [PATCH] (backend) lang: hello world --- backend/cPlusPlus/README_c_plus_plus.md | 3 ++ backend/cPlusPlus/pointer.md | 7 +++++ backend/java/README_java.md | 2 ++ backend/java/hello_world.md | 38 +++++++++++++++++++++++++ backend/java/install.md | 0 backend/ruby/README_ruby.md | 2 +- 6 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 backend/cPlusPlus/README_c_plus_plus.md create mode 100644 backend/cPlusPlus/pointer.md create mode 100644 backend/java/README_java.md create mode 100644 backend/java/hello_world.md create mode 100644 backend/java/install.md diff --git a/backend/cPlusPlus/README_c_plus_plus.md b/backend/cPlusPlus/README_c_plus_plus.md new file mode 100644 index 00000000..58f72101 --- /dev/null +++ b/backend/cPlusPlus/README_c_plus_plus.md @@ -0,0 +1,3 @@ + + +[pointer](pointer.md) \ No newline at end of file diff --git a/backend/cPlusPlus/pointer.md b/backend/cPlusPlus/pointer.md new file mode 100644 index 00000000..fbc5ef71 --- /dev/null +++ b/backend/cPlusPlus/pointer.md @@ -0,0 +1,7 @@ + + +## Dangling pointer + +A dangling pointer is a (non-NULL) pointer which points to unallocated (already freed) memory area. + +[wiki](https://en.wikipedia.org/wiki/Dangling_pointer) \ No newline at end of file diff --git a/backend/java/README_java.md b/backend/java/README_java.md new file mode 100644 index 00000000..51f4e869 --- /dev/null +++ b/backend/java/README_java.md @@ -0,0 +1,2 @@ + +[install](backend/java/install.md) \ No newline at end of file diff --git a/backend/java/hello_world.md b/backend/java/hello_world.md new file mode 100644 index 00000000..47ef1178 --- /dev/null +++ b/backend/java/hello_world.md @@ -0,0 +1,38 @@ + + +## Code + +```java +class Test +{ + public static void main(String []args) + { + System.out.println("My First Java Program."); + } +}; +``` + + +## Compile + +To compile the program, we must run the Java compiler (javac), with the name of the source file on the “command prompt” like as follows + +If everything is OK, the `javac` compiler creates a file called “Test.class” containing the byte code of the program. + +```sh +javac HelloWorld.java +``` + +## Execute + +- Create the program by typing it into a text editor and saving it to a file – HelloWorld.java. +- Compile it by typing “javac HelloWorld.java” in the terminal window. +- Execute (or run) it by typing “java HelloWorld” in the terminal window. + +```sh +java HelloWorld +``` + +## Resource + +[GfG | hello world ex](https://www.geeksforgeeks.org/java-hello-world-program/) \ No newline at end of file diff --git a/backend/java/install.md b/backend/java/install.md new file mode 100644 index 00000000..e69de29b diff --git a/backend/ruby/README_ruby.md b/backend/ruby/README_ruby.md index 2058c9cb..464458fc 100644 --- a/backend/ruby/README_ruby.md +++ b/backend/ruby/README_ruby.md @@ -2,7 +2,7 @@ [documentation](backend/ruby/documentation.md) -[[hello_world]] +[[backend/ruby/hello_world]] [[backend/ruby/ternary]]