Search Header Logo

Java Programming

Authored by Hanson Putro

Computers

University

Used 675+ times

Java Programming
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Perintah berikut digunakan untuk mencetak Hello World

System.out.println("Hello World");
System.out.println(Hello World);
system.out.println(Hello World);
system.out.println("Hello World");
System.Out.Println("Hello World");

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Perintah berikut digunakan untuk mendeklarasikan variabel it bertipe byte

it byte;
byte it;
it: byte;
byte: it;
Byte it;

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Pernyataan berikut yang salah

int merupakan tipe untuk bilangan bulat
double merupakan tipe untuk bilangan pecahan
boolean merupakan tipe untuk nilai logika benar-salah
char merupakan tipe untuk kumpulan karakter
String merupakan tipe yang sudah berupa struktur/kelas

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Perintah berikut digunakan untuk mengisi nilai abc ke xyz

abc = xyz;
xyz = abc;
abc == xyz;
xyz == abc;
abc -> xyz;

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Perintah berikut digunakan untuk membaca nilai integer

import java.util.Scanner;
Scanner sc = new Scanner(System.in);
int x = Scanner.nextInt();
x = sc.nextInt();
Scanner sc = new System(Scanner);

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Scanner input = new Scanner();<br />Perintah tersebut menghasilkan error karena

Konstruktor Scanner() perlu diberi parameter
Belum menggunakan fungsi nextInt()
Seharusnya tidak menggunakan perintah new
Input merupakan reserved word (tercetak tebal), tidak bisa digunakan sebagai variabel
Perintah membaca belum disimpan ke dalam variabel

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Perintah manakah yang mengeluarkan pesan kesalahan

int a = 2 - 3 * 4;
boolean b = c > d;
String e = 'f' + "gh";
double i = 6 % 3;
int j = 100 / 7;

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?

Discover more resources for Computers