java(1)

1.环境配置eclipse:

http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/mars/2/eclipse-java-mars-2-win32-x86_64.zip

2.Create project

package com.jikexueyuan.main;

public class main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("Hello world!");
	}

}

 3. 包com.jikexueyuan.main

4. package 类似于C# 中的namespace

5. 作用域修饰符:

访问权限   类   包  子类  其他包

    public     ∨   ∨   ∨     ∨

    protect    ∨   ∨   ∨     ×

    default    ∨   ∨   ×     ×

    private    ∨   ×   ×     ×

posted on 2016-04-27 11:06  言满天下  阅读(130)  评论(0编辑  收藏  举报

导航