Skip to content

Instantly share code, notes, and snippets.

@khannedy
Created October 16, 2011 03:48
Show Gist options
  • Select an option

  • Save khannedy/1290485 to your computer and use it in GitHub Desktop.

Select an option

Save khannedy/1290485 to your computer and use it in GitHub Desktop.
Membuat Interface dari Class Menggunakan NetBeans
/*
* Copyright (c) 2011, StripBandunk and/or its affiliates. All rights reserved.
*
* http://stripbandunk.com/
*
* STRIPBANDUNK PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package khannedy.belajar.belajarjava.netbeans;
/**
*
* @author Eko Kurniawan Khannedy
*/
public interface Sample {
String getNama();
void hello();
void sapa(String nama);
}
/*
* Copyright (c) 2011, StripBandunk and/or its affiliates. All rights reserved.
*
* http://stripbandunk.com/
*
* STRIPBANDUNK PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package khannedy.belajar.belajarjava.netbeans;
/**
*
* @author Eko Kurniawan Khannedy
*/
public class SampleClass implements Sample {
private String nama;
@Override
public String getNama() {
return nama;
}
public void setNama(String nama) {
this.nama = nama;
}
@Override
public void hello() {
System.out.println("Hello");
}
@Override
public void sapa(String nama) {
System.out.println("Hello " + nama);
}
}
/*
* Copyright (c) 2011, StripBandunk and/or its affiliates. All rights reserved.
*
* http://stripbandunk.com/
*
* STRIPBANDUNK PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package khannedy.belajar.belajarjava.netbeans;
/**
*
* @author Eko Kurniawan Khannedy
*/
public class SampleClass {
private String nama;
public String getNama() {
return nama;
}
public void setNama(String nama) {
this.nama = nama;
}
public void hello() {
System.out.println("Hello");
}
public void sapa(String nama) {
System.out.println("Hello " + nama);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment