java如何在“”内输出你定义的变量

 System.out.printf("【%s】再吃骨头。",this.name);
%s是String类型
 
 System.out.printf("你的汽车加了%d的油。",gasline);
gasline是int类型,%d是十进制



posted @ 2021-12-30 17:19  CcYcHu  阅读(263)  评论(0)    收藏  举报