Pre Quiz Pemrograman Berorientasi Obyek (Java)

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Achmatim
A
Achmatim
Community Contributor
Quizzes Created: 2 | Total Attempts: 1,873
| Attempts: 582 | Pertanyaan: 19
Please wait...
Pre Test - Pemrograman Berorientasi Obyek (Java) untuk kelompok KU Semester Gasal 2008/2009.

Kerjakan sesuai dengan kemampuan Anda masing-masing. Hasil yang diperoleh tidak akan berpengaruh terhadap nilai Anda.
Question 1 / 19
0 %
0/100
Score 0/100
1. Salah satu operator aritmatika yang akan menghasilkan sisa hasil bagi dari 2 operand, yaitu:

Explanation

Operator aritmatika yang akan menghasilkan sisa hasil bagi dari 2 operand adalah %. Operator ini disebut modulo atau modulus. Ketika operand pertama dibagi dengan operand kedua, operator % akan mengembalikan sisa hasil bagi dari operasi tersebut. Misalnya, jika operand pertama adalah 7 dan operand kedua adalah 3, maka hasilnya adalah 1 karena 7 dibagi dengan 3 menghasilkan sisa 1.

Submit
Please wait...
About This Quiz
Pre Quiz Pemrograman Berorientasi Obyek (Java) - Quiz

Personalize your quiz and earn a certificate with your name on it!
2. Konsep OOP yang memungkinkan suatu class dapat menurunkan sifat ke class lain, adalah:

Explanation

Inheritance is the OOP concept that allows a class to inherit or acquire the properties and behaviors of another class. It enables code reusability and promotes the hierarchical organization of classes. Inheritance allows a class to inherit the attributes and methods of another class, known as the parent or base class, and also allows the derived class to add its own unique attributes and methods. This concept facilitates the creation of more specialized classes based on existing ones, promoting code efficiency and modularity.

Submit
3. Berikut ini merupakan jenis bahasa program yang berbasis compiler (compiled programming), kecuali:

Explanation

The given options consist of programming languages that are based on compilers, except for Perl. Java, C, and Pascal are all compiled programming languages that require a compiler to convert the source code into machine code or bytecode. However, Perl is an interpreted programming language, which means it does not need to be compiled before execution. Instead, the Perl interpreter reads and executes the code directly. Therefore, Perl is the correct answer as it is not a compiled programming language.

Submit
4. Fitur di Java yang memungkinkan programmer mengatur penanganan error yang terjadi dalam program, disebut:

Explanation

Exception handling adalah fitur di Java yang memungkinkan programmer untuk mengatur penanganan error yang terjadi dalam program. Dengan menggunakan exception handling, programmer dapat menangani dan mengelola error secara terstruktur, sehingga program dapat tetap berjalan dengan baik meskipun terjadi error.

Submit
5. Suatu method yang akan dijalankan otomatis saat object dari class dibuat, dikenal dengan:

Explanation

A constructor is a special method that is automatically executed when an object of a class is created. It is used to initialize the object's state and perform any necessary setup operations. In this case, the correct answer is "Constructor" because it is the method that is executed automatically when an object is created.

Submit
6. Jika ingin membuat aplikasi Java untuk dijalankan di perangkat mobile, maka paling tepat menggunakan:

Explanation

J2ME is the most appropriate option for developing a Java application to run on mobile devices. J2ME, or Java 2 Micro Edition, is specifically designed for resource-constrained devices like mobile phones. It provides a platform for developing applications that can run efficiently on mobile devices with limited processing power, memory, and display capabilities. J2SDK, Applet, and Servlet are not specifically designed for mobile devices and may not provide the necessary features and optimizations required for mobile application development.

Submit
7. Pengecekan tipe data di Java dilakukan saat:

Explanation

In Java, type checking is performed during the compilation of a program. This means that any errors or mismatches in the types of variables or expressions will be detected and reported by the compiler before the program is executed. This helps to ensure that the program is syntactically correct and reduces the likelihood of runtime errors related to type mismatches. Therefore, the correct answer is "Program dikompilasi."

Submit
8. Komentar program dalam Java dapat menggunakan perintah:

Explanation

The correct answer is "// dan /* ... */" because in Java, comments can be written using the double forward slash (//) for single-line comments and the forward slash and asterisk (/* ... */) for multi-line comments.

Submit
9. Apa yang dimaksud dengan method overloading?

Explanation

Method overloading adalah konsep dalam pemrograman dimana terdapat beberapa method dengan nama yang sama, tetapi memiliki parameter yang berbeda. Dengan menggunakan method overloading, kita dapat memiliki beberapa versi dari method yang berbeda dalam hal parameter yang diterima. Hal ini memungkinkan kita untuk menggunakan method yang sama dengan cara yang berbeda tergantung pada tipe atau jumlah parameter yang kita berikan saat memanggil method tersebut.

Submit
10. Jika suatu method dideklarasikan sebagai protected, maka:

Explanation

When a method is declared as protected, it can be accessed by the class where the method is located and its subclasses. This means that any class that extends the class where the protected method is declared can access and use that method. However, classes that are not subclasses of the class where the protected method is declared cannot access or use the method.

Submit
11. Berikut ini editor yang dapat digunakan untuk menuliskan program Java, kecuali:

Explanation

JavaBeans is not an editor that can be used to write Java programs. It is a software component model for Java, used to create reusable components. It provides a set of guidelines for creating Java classes that can be easily integrated into different development environments. Therefore, JavaBeans is not a valid option for an editor to write Java programs.

Submit
12. Berikut ini merupakan keyword yang terdapat dalam Java, kecuali:

Explanation

The given keywords are "if", "break", and "goto". These are all valid keywords in the Java programming language. However, "string" is not a keyword in Java. It is a class that represents a sequence of characters and is used to manipulate strings in Java.

Submit
13. Secara otomatis Java akan menghapus pengalokasian memory yang sudah tidak digunakan dengan proses yang disebut:

Explanation

Java memiliki mekanisme pengelolaan memori otomatis yang disebut "garbage collector". Garbage collector bertugas untuk menghapus atau membebaskan memori yang tidak lagi digunakan oleh program. Proses ini dilakukan secara otomatis oleh Java, sehingga pengguna tidak perlu secara manual menghapus memori yang tidak digunakan. Dengan adanya garbage collector, program Java menjadi lebih efisien dalam penggunaan memori dan mencegah terjadinya memory leak.

Submit
14. Berikut ini merupakan penamaan variabel yang benar dalam Java, kecuali:

Explanation

The variable "nilai-mhs" is not a correct variable name in Java because it contains a hyphen ("-"). In Java, variable names cannot contain special characters like hyphens. Variable names can only consist of letters, numbers, and underscores. Therefore, "nilai-mhs" is not a valid variable name in Java.

Submit
15. Untuk menjalankan program Java, komputer harus terinstall:

Explanation

To run a Java program, the computer must have JRE (Java Runtime Environment) installed. JRE is responsible for executing Java applications and provides the necessary runtime environment. It includes the Java Virtual Machine (JVM) and other libraries and components required to run Java programs. JRE does not include the Java development tools like the Java Compiler (JDK) or J2SDK (Java 2 Software Development Kit). Therefore, JRE is the correct answer as it is specifically designed for running Java applications.

Submit
16. Pernyataan yang benar berhubungan dengan program Java, kecuali:

Explanation

The correct answer is "Method main() harus ada dalam setiap class program Java". This statement is incorrect because it is not necessary for every class in a Java program to have a main() method. The main() method is only required in the class that serves as the entry point for the program. Other classes can be created without a main() method.

Submit
17. Berikut ini merupakan tipe data dasar dalam Java, kecuali:

Explanation

The given options represent different data types in Java. "long", "int", and "float" are all valid data types in Java. However, "string" is not a valid data type in Java. The correct data type for representing textual data in Java is "String" (with a capital "S"). Therefore, the correct answer is "string".

Submit
18. Berikut ini pernyataan yang benar berhubungan dengan class dan object dalam Java, kecuali:

Explanation

The given statement "Object terdiri dari keyword dan method" is incorrect. Objects in Java do not consist of keywords and methods. Objects are instances of classes and they have state (data) and behavior (methods). The statement is incorrect because it implies that objects are composed of keywords and methods, which is not true.

Submit
19. Untuk mengakses class atas (parent class) dapat menggunakan keyword:

Explanation

The keyword "super" is used to access the parent class. It is used when there is a need to refer to a method or variable from the parent class within the child class. By using "super", the child class can access and utilize the methods and variables defined in the parent class.

Submit
View My Results

Quiz Review Timeline (Updated): Jul 22, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 31, 2008
    Quiz Created by
    Achmatim
Cancel
  • All
    All (19)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Salah satu operator aritmatika yang akan menghasilkan sisa hasil bagi...
Konsep OOP yang memungkinkan suatu class dapat menurunkan sifat ke...
Berikut ini merupakan jenis bahasa program yang berbasis compiler...
Fitur di Java yang memungkinkan programmer mengatur penanganan error...
Suatu method yang akan dijalankan otomatis saat object dari class...
Jika ingin membuat aplikasi Java untuk dijalankan di perangkat mobile,...
Pengecekan tipe data di Java dilakukan saat:
Komentar program dalam Java dapat menggunakan perintah:
Apa yang dimaksud dengan method overloading?
Jika suatu method dideklarasikan sebagai protected, maka:
Berikut ini editor yang dapat digunakan untuk menuliskan program Java,...
Berikut ini merupakan keyword yang terdapat dalam Java, kecuali:
Secara otomatis Java akan menghapus pengalokasian memory yang sudah...
Berikut ini merupakan penamaan variabel yang benar dalam Java,...
Untuk menjalankan program Java, komputer harus terinstall:
Pernyataan yang benar berhubungan dengan program Java, kecuali:
Berikut ini merupakan tipe data dasar dalam Java, kecuali:
Berikut ini pernyataan yang benar berhubungan dengan class dan object...
Untuk mengakses class atas (parent class) dapat menggunakan keyword:
Alert!

Advertisement