ICT2612 Latest exam pack questions and answers and summarized notes for exam preparation. Updated for 2024 exams . For assistance Whats-App.0.6.7..1.7.1..1.7.3.9 . All the best on your exams!!
1) Consider the following program and predict the output
public class Test {
public void print(Integer i) {
System.out.println("Integer");
}
public void print(int i) {
System.out.println("int");
}
public void print(long i) {
System.out.println("long");
}
public static void main(String args[]) {
Test test = new Test();
test.print(10);
}
}
a. Integer
b. The program results in a compiler error (“ambiguous overload”).
c. Long
d. int
2) Which term best describes "a program that duplicates the look and feel of a particular
device"?
a. operating system
b. mobile application
c. emulator
d. smartphone
3) What will be the output of following Java code?
public class Main {
public static void main(String[] args) {
System.out.println(Math.copySign(100.6, -200.6));
}
}
a. -200.6
b. 100.6
c. -100.6
d. 200.6
,4) Consider the following program:
class SuperClass {
SuperClass() {
foo();
}
public void foo() {
System.out.println("In SuperClass.foo()");
}
}
Class SubClass extends SuperClass {
private String member;
public SubClass() {
member = "HI";
}
public void foo() {
System.out.println("In SubClass.foo(): " + member.toLowerCase());
}
}
public class Test {
public static void main(String[] args){
SuperClass reference = new SubClass();
reference.foo();
This program prints the following:
a. In Derived.foo(): hi
b. In SuperClass.foo() In Derived.foo(): hi
c. In SuperClass.foo()
d. This program throws a NullPointerException.
5) Which of the following statements is a way of making more Java functions available to your
specific program?
a. import statement
b. include statement
c. reference statement
d. assignment statement
6) Which of the following is the parent class of service?
a. object
b. contextThemeWrapper
c. Context
d. contextWrapper
, 7) Which term best describes a blueprint or a template for creating objects by defining its
properties?
a. Widget
b. App
c. Class
d. Control
8) What is the return type of a method that returns nothing?
a. int
b. Double
c. void
d. null
9) choose the correct option based on this program:
import java.util.*;
class UtilitiesTest {
public static void main(String[] args) {
List < int > intList = new ArrayList < > ();
intList.add(10);
intList.add(20);
System.out.println("The list is: " + intList);
a. It prints the following: The list is: [10, 20]
b. It results in a runtime exception
c. It prints the following: The list is: [20, 10]
d. It results in a compiler error
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller iStudy. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R50,00. You're not tied to anything after your purchase.