public class MyLable{

 String x,y; public MyLable(String x1,String y1)//构造函数不能有返回值,去掉void,如果有话,编译器把它看作普通函数
   { 
     
this.x=x1;
this.y=y1;
   }
   
 void print()
  {
  
   System.out.println(x+y);
   
  }
  
 public static void main(String[] args)
 {

MyLable testLable = new MyLable("hello ","world");
testLable.print();
    
 }
  
}
希望把基础的再看看,这样的问题不应该错的