printf error can't launch java eclipse -


my printf contains error. rest of code done, because of error in printf, can't launch java. please help. main class done.

package id.web.aditya;  public class roda {  private int diameter; private string warna; private string merk; private string keterangan;  public string getmerk() {     return merk; } public void setmerk(string merk) {     merk = merk; }  public int getdiameter() {     return diameter; } public void setdiameter(int diameter) {     this.diameter = diameter; } public string getwarna() {     return warna; } public void setwarna(string warna) {     this.warna = warna; }   public string getketerangan() {     return keterangan; } public void setketerangan(string keterangan) {     this.keterangan = keterangan; }  public void tampilanketerangan(){     system.out.printf("roda %s merk: %s warna: %s diameter: %d \n ",              keterangan, merk, warna, diameter); }   public void berhenti(){     tampilanketerangan();     system.out.println("kurangi kecepatan");     system.out.println("mulai berhenti..");     system.out.println("akhirna berhenti");     system.out.println("--------------------");  } public void berputar(){     tampilanketerangan();     system.out.println("mulai berputar");     system.out.println("berputar");     system.out.println("berputar makin cepat");     system.out.println("----------------------"); }  } 

package id.web.aditya;  public class mobil {  /**  * @param args  */ public static void main(string[] args) {     // todo auto-generated method stub      roda rodauntukditest = new roda();     rodauntukditest.setdiameter(80);     rodauntukditest.setmerk("achiles");     rodauntukditest.setwarna("hitam");     rodauntukditest.setketerangan("");     rodauntukditest.berhenti();     rodauntukditest.berputar(); }  } 

exception in thread "main" java.lang.error: unresolved compilation problem: method printf(locale, string, object[]) in type printstream not applicable arguments (string, string, string, string, int)

string format feature introduced in java 1.5. apparently using java version or compilation option prior version. if using eclipse open project properties (alt + enter on project). @ tab java compiler.

eclipse properties

here can set compiler compliance level. have newer java version installed. in case eclipse shows above mention error.

i expect show "the method printf(string, string, string, string, integer) undefined type printstream". doesn't might little bit confusing.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -