package com.itjob.javabasic;

public class Triangle {
	public static void main(String[] args) {
		/*int x = 7;
		int y = x;
		String s = "Hello";
		String t = s;
		t = "world";
		System.out.println(s);
		System.out.println(t);*/
		// Triangle triangle = new Triangle();
		// triangle.printTriangle(5);
		
		String str = "amigo";
		testRef(str);
		System.out.print(str);
	}

	public static void testRef(String str)
	{
		str = "hello";
	}
	
	public void printTriangle(int layer) {
		for (int i = 0; i < layer; i++) {
			for (int j = 0; j < layer - i; j++) {
				System.out.print(" ");// 输出前面的空格
			}
			
			for (int j = 0; j < i + 1; j++) {
				System.out.print(i + 1 + " ");// 输出数字和空格
			}
			System.out.println();
		}
	}
}
