02_JAVA project creation and input/output method description
Hello i'm MrChooCAI~!!!
JAVA project creation and input/output
method description.
Github
url: https://github.com/Chooyoungjun/javastudy/tree/main/01_print_method_input_method
JAVA
project creation
[Practice]
From now on, we'll practice creating from project to class based on
the Eclipse program.
1.
Create project
The snapshot above shows how to create a project in Eclipse. If you follow the snapshot above, you can create a javproject..
2.
Create package
You can create a package
like the snapshot above.
3.
Create java class
You can create a class as
well. When creating a project or package, you just have to follow it and create
it. However, when creating a class, it is recommended to set up the main method
auto-complete function, so I took a snapshot as follows.
Please check the public static @#$!@$ below. If you check it like this, you can see that it's completed as shown in the snap shot below.
I created a Java project
like SnapShot above. Now you've completed the project creation, the foundation
for starting the Java project~
Input/Output
method
Output
method
[flow
chart]
As shown in the figure above, the output method is a method of sending a command to the computer to print it to the console. As explained earlier, you need to know the rules to give these commands to your computer, and you can understand them by referring to the snapshot below.
[Type
of output method]
1.
System.out.print(value);
2.
System.out.println(value);
3.
System.out.printf(value);
It
can be organized into three things as shown in the picture above. To check the
difference above, you can refer to the result by pressing Ctrl+f11 to execute
the code shown in the snapshot below.
In
simple terms, “print” is an output without enter “println” is an output
followed by an enter “printf” is a formatted output.
Input
Method
So
far, we've learned about the output method. Now, let's start explaining the
input method.
[flow
chart]
This
is a method that receives information from the keyboard from the computer, such
as the snapshot above.
[practice]
The
above snapshot shows four input methods (sc.next(), sc.nextInt(), sc.nextFloat(),
and sc.nextLine(). Each feature is that sc.next receives characters that are
not recognized after spacing, sc.nextInt() receives integers, sc.nextFloat()
receives mistakes, and sc.nextLine receives strings that can be entered until
spacing.
So,
we learned how to make a project and how to use input/output methods.
Comments
Post a Comment