Pilihan Ganda
1. Kumpulan dari method-method yang belum terdapat operasi di dalam tubuh method tersebut disebut
a. Abstract class
b. Inheritance
c. Interface
d. Method abstract
e. Implements
Jawabannya : C
a. Inheritance
b. Interface
c. Overriding
d. Overloading
e. Implements
Jawabannya : A
a. Abstract class
b. Class
c. Multiple interface
d. Implementasi
e. Interface
Jawabannya : A
a. Class math
b. Class string
e. Class procces
Jawabannya : B
Jawabannya : C
a. Boolean
b. Byte
c. Character
d. Double
Jawabannya : E
7. Class yang menyediakan beberapa flied dan method bermanfaat disebut ...
a. Class system
b. Class math
c. Class string
d. Class wrapper
e. Boolean
Jawabannya : A
8. Keyword penting dalam java dalam hal exception handing adalah ...
a. Try
b. Catch
c. Finally
d. Throw
Jawabannya : E
a. Class throwable
b. Php
c. Metode
d. Throw
e. Catch
Jawabannya : A
10. Keyword yang digunakan dalam suatu block program adalah ...
a. Try
b. Throw
c. Throws
d. Catch
e. Finally
Jawabannya : A
B. Essay
Jawab : interface adalah kumpulan dari method yang belum terdapat operasi di dalam tubuh method
tersebut
Jawab : Pewarisan (inhertance) adalah pewarisan method dan atribut dari superclass kepada sub-classnya
!
Jawab : - class math
- Class string
- Class wrapper
- Class proccess
Jawab : exception adalah sebuah peristiwa yang menjalankan alur proses normal pada program
Jawab : - Try
- Catch
- Finally
- Throw
- Throws
1. Sebutkan tiga prinsip utama dalam Pemrograman Berorientasi
Obyek
a. Inheritance, Polymorphism, Encapsulation
b. Polymorphism, Inheritance, Class
c. Public, Protected, Private
d. Encapsulation, Polymorphism, Extend
class Test {
public static void main(String[] args) {
int x = 0;
int y = 0;
while (x < 5) {
System.out.print(x + “” + y + “ “);
x = x + 1;
}
}
}
12. y = y + x;
(00112336410)
13. y = y + 2;
if( y > 4 ) {
y = y – 1;
}
(0214253647)
14. x = x + 1;
y = y + x;
(113459)
15. if ( y < 5 ) {
x = x + 1;
if ( y < 3 ) {
x = x – 1;
}
}
y = y + 2;
(2254)