Constructor call must be the first statement in a constructor

Constructor call must be the first statement in a constructor

package thinkinjava;

public class Assignment {
	 String name ;
	Assignment(){	
		
		System.out.println("bob");
		
		this("k");
	
	}
	Assignment(String name){
		System.out.println(name);
		
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		
		 new Assignment();
		
		
		
		
		}
		
	}
调用必须在第一行。

你可能感兴趣的:(Constructor call must be the first statement in a constructor)