[JAVA] What is different from the PHP language. [Note]

What is different from the PHP language. The way of thinking of class call and method call is different. When calling a class in the same package, there is no need to import it separately (corresponding to PHP include etc.). Also, I felt that the idea that main is a special existence is not PHP.

demojava/demo13/Demo13.java


package demojava.demo13;

public class Demo13 {
	public static void main(String[] args) {
		Test1 test1 = new Test1();
		System.out.println(test1.name());
	}
}

demojava/demo13/Test1.java


package demojava.demo13;

public class Test1 {
	public String name() {
		return "Test 1";
	}
}

Recommended Posts

What is different from the PHP language. [Note]
What is the pluck method?
What is the BufferedReader class?
What is the constructor for?
What is the initialize method?
'% 02d' What is the percentage of% 2?
[Technical Note] What is Object Oriented?
The times may come? Aspect Oriented Programming, What is the AspectJ Language?
[Swift] The color of the Navigation Bar is different (lighter) from the specified color.
What is a class in Java language (3 /?)
What is the right migration data type? ??
What is testing? ・ About the importance of testing
What is the best file reading (Java)
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
What is the model test code testing
What is the main method in Java?
What is the data structure of ActionText?
What is the Facade pattern useful for?
What is CHECKSTYLE: OFF found in the Java source? Checkstyle to know from
[Beginner] What is Docker in the first place? Easy-to-understand explanation from the basics!
[Ruby] What is the slice method? Let's solve the example and understand the difference from slice!
What is ... (3 dots) found in the Java source? Variadic arguments to know from
What is Pullback doing in The Composable Architecture
What is JSP? ~ Let's know the basics of JSP !! ~
What is the Java Servlet / JSP MVC model?
What is the volatile modifier for Java variables?
What is the difference between SimpleDateFormat and DateTimeFormatter? ??
What is Cubby
What is Docker?
What is null? ]
What is java
What is Keycloak
[Comparison verification] How different is the development productivity of Spring Boot apps from the past?
What is maven?
What is Jackson?
Get the value from the array and find out what number it is included in
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
What is Facade? ??
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is centOS
What is RubyGem?
What is programming?
What is before_action?
What is Docker
What is Byte?
What is Tomcat
What is the difference between a class and a struct? ?? ??
What is the difference between System Spec and Feature Spec?
Java language from the perspective of Kotlin and C #
[Rails] What is the difference between redirect and render?
[JAVA] What is the difference between interface and abstract? ?? ??