I tried to interact with Java

0.Opening Jinglebe-le ♪ Jinglebe-le ♪ The bell rings- ♪ As the world makes a fool of people and the rear charge spreads to popular spots, I would like to make Christmas Eve a fun Christmas Eve by interacting with Java ♂. Take off ~~ d ... ~~ Kuribocchi!

1. What is Java?

That said, I don't know Java yet, so I took a quick look at Java.

1-1. The birth of Java !!

Originally, it was created around 1991 by Sun Microsystems, Inc. of the United States (now absorbed by Oracle) as a programming language for software development for home appliances. From there, improvements were made, and Java was announced at SunWorld in 1995. The reason why Java got a lot of attention was the ability to develop small programs called "applets" that run on Web browsers. For this reason, it was once misunderstood as "a language for the Internet for making applets." ** Java is a "general-purpose programming language that can also create applets" and is a versatile language **. That is the concept.

1-2. Main features of java

--Provided free of charge --Once created, it can be executed anywhere --Syntax similar to C or C ++ --Support for object-oriented programming --A lot of multifunctional libraries --Concurrent processing --Classification by package

2. This pilot

The textbook that will be taken care of this time is "Clear Java -Introduction-" written by Professor Nobuhiro Shibata. Onacious!

3. Execution environment

Use eclipse, an IDE (Integrated Development Environment).

4. I actually touched it

I can't get the screenshot, so I can get the source code instead.

4-1. A program that outputs characters to the screen

package Sample;

//画面に表示を行うプログラム

public class SampleA {

	public static void main(String[] args) {

System.out.print ("Hello!"); // printf ("Hello!") In C language;

System.out.print ("X'mas" + "EVE !!"); // Character concatenation

System.out.println ("Rear charge ... \ n Blast !!!"); / * \ n is a line break as in C language. You can put it between character literals! * /

	}

}

4-2. Trial program using variables

package Sample;

// Library in C (like #include <stdio.h>) import java.util.Random; // Library for generating random numbers import java.util.Scanner; // Library for accepting keyboard input

public class SampleB {

	public static void main(String[] args) {

//ライブラリにある関数を使いやすく定義 Random rand = new Random (); // The one with the same role as the rand function in C language Scanner stdIn = new Scanner (System.in); // Same role as scanf in C language

		int a;
	
		a = 2;
	
		int b = -1;
	
		double x = 1.5 * 2;

final double PI = 3.14159; // Variable whose value cannot be rewritten (const in C language)

		x = rand.nextDouble();

// The value in parentheses is the value after calculation (printf ("% d", PI * x * x) in c language) System.out.println (The area of a circle with "radius" + x + "is" + (PI * x * x) + ".");

System.out.print ("value of integer a:");

		a = stdIn.nextInt();

		System.out.println("a / 2 = "+ a /2);

		System.out.println("a % 2 = "+ a % 2);

String s = "cake"; // String type (char type array in c language)

System.out.println ("The string s is" + s + ".");

	}
	
}

5. Take your impressions

Java has a longer syntax than C language, and the syntax may be different from C language, so I felt a little uncomfortable. However, the input assistance is excellent, and I am grateful that you do not have to hit each time if you use the Tab key. Also, I found it interesting to be able to connect characters. (Because it was like "I hava a pen. ♪ I have an apple. ♪ Oh, Apple Pen. ♪" of a certain PPAP (laughs)) 6.Ending I tried to interact with Java, but this time it was the beginning of the beginning, and I could not touch the true value of Java. However, not only this time, I would like to continue to deepen exchanges with Java. Well, seriously aside, thanks to Java, I have good memories that are comparable to Ria Mitsuru. (maybe) … Is it going to go to the mouse country alone from now on?

Recommended Posts

I tried to interact with Java
I tried to make Basic authentication with Java
I tried to break a block with java (1)
I tried to implement TCP / IP + BIO with JAVA
I tried UDP communication with Java
I tried to implement Stalin sort with Java Collector
I tried to summarize Java learning (1)
I tried to summarize Java 8 now
I tried to create a java8 development environment with Chocolatey
I tried to modernize a Java EE application with OpenShift.
I tried to summarize Java lambda expressions
I tried to get started with WebAssembly
I tried using OpenCV with Java + Tomcat
I tried to implement ModanShogi with Kinx
I tried to make an Android application with MVC now (Java)
I tried to manage struts configuration with Coggle
I tried to manage login information with JMX
java I tried to break a simple block
I tried to implement deep learning in Java
I want to use java8 forEach with index
I tried to output multiplication table in Java
I tried to create Alexa skill in Java
I tried DI with Ruby
Java to play with Function
I tried Drools (Java, InputStream)
Connect to DB with Java
Connect to MySQL 8 with Java
I tried using Java REPL
I tried UPSERT with PostgreSQL.
I tried BIND with Docker
I tried to verify yum-cron
I tried metaprogramming in Java
I tried what I wanted to try with Stream softly.
I tried to implement file upload with Spring MVC
I tried to implement Firebase push notification in Java
I tried to operate SQS using AWS Java SDK
# 2 [Note] I tried to calculate multiplication tables in Java.
I started MySQL 5.7 with docker-compose and tried to connect
I tried to get started with Spring Data JPA
I tried to create a Clova skill in Java
I tried to make a login function in Java
I tried to draw animation with Blazor + canvas API
I tried OCR processing a PDF file with Java
I want to transition screens with kotlin and java!
[Java] I tried to implement Yahoo API product search
I tried to implement the Euclidean algorithm in Java
~ I tried to learn functional programming in Java now ~
I want to get along with Map [Java beginner]
I used to make nc (netcat) with JAVA normally
roman numerals (I tried to simplify it with hash)
I tried to find out what changed in Java 9
[Java] I tried to connect using a connection pool with Servlet (tomcat) & MySQL & Java
I tried to create a shopping site administrator function / screen with Java and Spring
I tried to make an introduction to PHP + MySQL with Docker
Java to learn with ramen [Part 1]
I tried to chew C # (indexer)
I tried to increase the processing speed with spiritual engineering
[Java] Points to note with Arrays.asList ()
[JDBC] I tried to access the SQLite3 database from Java.
I tried to summarize the basics of kotlin and java
[Rails] I tried to create a mini app with FullCalendar