First knowledge Java output Hello World!__java

Source: Internet
Author: User

with the beginning of sophomore year, we also began to contact a new programming language--java

when the class made a fool, did not keep up with the teacher's explanation, in their own operation some confused, fortunately, the teacher patiently explained.

I succeeded in compiling a few small programs.

public class Hello {public
	static void Main (string[] args) {
		System.out.println "Hello! Java ");
	}
}

public class Sum {public
	static void Main (String args[]) {
		int i, sum = 0;
		for (i = 1; I <= i++) {
			sum = i;
		}
		SYSTEM.OUT.PRINTLN (sum);
	}

public class Temp {public
	static void Main (String args[]) {
		int a = 2, b = 3;
		System.out.println ("Initial A's value is" + a);
		System.out.println ("Initial B's value is" + B);
		int temp;
		temp = A;
		A = b;
		b = temp;
		System.out.println ("The value of a after the exchange is" + a);
		System.out.println ("The value of B after swap is" + b);
	}
}

First of all, in the absence of a good preview of the situation, to understand its face object characteristics of this is still some difficulties, the teacher's patience to explain and look at the textbook, finally is more understandable. This training is some basic things, but also happy to find it with C as a programming language in common. But the cross-platform nature of Java is unmatched by other languages.

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.