First day of Java Foundation

Source: Internet
Author: User

A Java program can be thought of as a collection of a series of objects that work together by invoking each other's methods.

Object: An object is an instance of a class that has state and behavior.

A dog is an object. Status: Color, name, variety, behavior: wagging the tail, barking, eating.

Class: Is a template that describes the behavior and state of a class of objects

Method: The method is the behavior, a class can have many methods. Logical operations, data modifications, and all actions are done in the method.

Instance variables: Each object has a unique instance variable, and the state of the object is determined by the value of these instance variables.

Print String Helloalbert

public class Helloalbert
{

/* First Java program

* It will print the string Helloalbert

*/

public static void Main (String [] args) {

System.out.println ("Helloalbert");//Print Helloalbert

}
}

Error occurred:

Solution: Javac Helloalbert.java

Java Helloalbert

First day of Java Foundation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.