Search Header Logo

Pemrograman Berorientasi Obyek Part 2

Authored by Agus Agvistoman

1st - 5th Grade

Used 2+ times

Pemrograman Berorientasi Obyek Part 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Berikut adalah cara inisialisasi variabel bertipe class string, kecuali:

String me = new String(“Inisialisasi 1”);

String me;

me = new String “inisialisasi 1” ;

String me;

me = new String(“inisialisasi 1”);

String me;

me = “inisialisasi 1”;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Method yang digunakan untuk membandingkan dua buah data string adalah …

equal()

concat()

length()

equals()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Method yang digunakan untuk mengubah seluruh huruf dalam string menjadi huruf

besar/kapital adalah …

UpperCase()

toUperCase()

toUpperCase()

isUpperCase()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Perhatikan potongan program berikut :

1. public class Substring {

2. public static void main( String args[] ) {

3. String str = new String("MahaDewa");

4. System.out.println(str.substring(2));

5. System.out.println(str.substring(3,7));

6. }

7. }


Jika program di atas dijalankan maka pada baris ke 4 akan menghasilkan keluaran …

ahaDewa

h

aDewa

haDewa

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Untuk soal no. 24 dan 25, Perhatikan potongan program berikut :

1. public class Substring {

2. public static void main( String args[] ) {

3. String str = new String("MahaDewa");

4. System.out.println(str.substring(2));

5. System.out.println(str.substring(3,7));

6. }

7. }


Sedangkan hasil keluaran pada baris ke 5 adalah …

aDewa

haDewa

aDew

haDe

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?