SlideShare a Scribd company logo
Quiz Java
Geek Time - Janvier 2017
Khaled HALLEB
Consultant - OLBATI
OLBATI © 2016 - Geek Time November 2016 2
Question 1
TreeMap class is used to implement which collection interface. Select the one correct answer
A. Set
B. SortedSet
C. List
D. Tree
E. SortedMap
OLBATI © 2016 - Geek Time November 2016 3
Question 2
Q2. How can you force garbage collection of an object?
A. Garbage collection cannot be forced.
B. Call System.gc().
C. Call System.gc() passing in a reference to the object to be garbage collected.
D. Call Runtime.gc().
E. Set all references to the object to new values(null, for example).
OLBATI © 2016 - Geek Time November 2016 4
Question 3
3. Given the following code:
public class Example {
public static void main(String args[]) {
Date d1 = new Date (99, 11, 31);
Date d2 = new Date (99, 11, 31);
method(d1, d2);
System.out.println("d1 is " + d1
+ "nd2 is " + d2);
}
public static void method(Date d1, Date d2) {
d2.setYear (100);
d1 = d2;
}}
Which one or more of the following correctly describe the behavior when this
program is compiled and run?
a) compilation is successful and the output is:
d1 is Fri December 31 00:00:00 GMT 1999
d2 is Fri December 31 00:00:00 GMT 1999
b) compilation is successful and the output is:
d1 is Fri December 31 00:00:00 GMT 1999
d2 is Sun December 31 00:00:00 GMT 2000
c) compilation is successful and the output is:
d1 is Sun December 31 00:00:00 GMT 2000
d2 is Sun December 31 00:00:00 GMT 2000
d) the assignment 'd1 = d2' is rejected by the compiler because the Date class cannot overload the operator '='.
e) the expression (d1 is " + d1 + "nd2 is " + d2) is rejected by the compiler because the Date class cannot overload the
operator '+'.
OLBATI © 2016 - Geek Time November 2016 5
Réponse 1
TreeMap class is used to implement which collection interface. Select the one correct answer
Correct Answer: E
OLBATI © 2016 - Geek Time November 2016 6
Réponse 2
Q2. How can you force garbage collection of an object?
Correct Answer: A
OLBATI © 2016 - Geek Time November 2016 7
Réponse 3
3. Given the following code:
public class Example {
public static void main(String args[]) {
Date d1 = new Date (99, 11, 31);
Date d2 = new Date (99, 11, 31);
method(d1, d2);
System.out.println("d1 is " + d1
+ "nd2 is " + d2);
}
public static void method(Date d1, Date d2) {
d2.setYear (100);
d1 = d2;
}}
Correct Answer: B
OLBATI © 2016 - Geek Time November 2016 8
Thanks !
Any questions ?
khaled.halleb@olbati.com

More Related Content

PPT
Maps&hash tables
PDF
Java & OOP Core Concept
PDF
CS-141 Java programming II ASSIGNMENT 2
PPT
Heaps & Adaptable priority Queues
PPT
Algorithm analysis basics - Seven Functions/Big-Oh/Omega/Theta
PDF
Chapter 1 Basic Concepts
PDF
Jsr310
PDF
構文や語彙意味論の分析成果をプログラムとして具現化する言語 パターンマッチAPIの可能性
Maps&hash tables
Java & OOP Core Concept
CS-141 Java programming II ASSIGNMENT 2
Heaps & Adaptable priority Queues
Algorithm analysis basics - Seven Functions/Big-Oh/Omega/Theta
Chapter 1 Basic Concepts
Jsr310
構文や語彙意味論の分析成果をプログラムとして具現化する言語 パターンマッチAPIの可能性

What's hot (20)

PPTX
WF ED 540, Class Meeting 2 - Identifying & converting data types, 2016
PDF
04 - Scala. Type of natural numbers
PPTX
DOCX
Control system lab nyquist plot
PDF
Functional Programming for Fun and Profit
PPTX
[Paper Reading] Generalized Sub-Query Fusion for Eliminating Redundant I/O fr...
PDF
Digital Differential Analyzer Line Drawing Algorithm in C
PDF
Matlab integration
PDF
MBrace: Large-scale cloud computation with F# (CUFP 2014)
PDF
MBrace: Cloud Computing with F#
PDF
Atomic algorithm and the servers' s use to find the Hamiltonian cycles
PDF
Assignment for Factory Method Design Pattern in C# [ANSWERS]
PPTX
Butterfly Counting in Bipartite Networks
PDF
Workshop with python qgis
ODP
Pick up the low-hanging concurrency fruit
DOCX
CLASS XII COMPUTER SCIENCE MONTHLY TEST PAPER
PPTX
Lessons learned from functional programming
PDF
01_NYC Elevator Project Summary
PDF
C programs Set 2
PDF
Automated Equation Processing and Rendering Workflows for Publishers
WF ED 540, Class Meeting 2 - Identifying & converting data types, 2016
04 - Scala. Type of natural numbers
Control system lab nyquist plot
Functional Programming for Fun and Profit
[Paper Reading] Generalized Sub-Query Fusion for Eliminating Redundant I/O fr...
Digital Differential Analyzer Line Drawing Algorithm in C
Matlab integration
MBrace: Large-scale cloud computation with F# (CUFP 2014)
MBrace: Cloud Computing with F#
Atomic algorithm and the servers' s use to find the Hamiltonian cycles
Assignment for Factory Method Design Pattern in C# [ANSWERS]
Butterfly Counting in Bipartite Networks
Workshop with python qgis
Pick up the low-hanging concurrency fruit
CLASS XII COMPUTER SCIENCE MONTHLY TEST PAPER
Lessons learned from functional programming
01_NYC Elevator Project Summary
C programs Set 2
Automated Equation Processing and Rendering Workflows for Publishers
Ad

Viewers also liked (20)

PPTX
TSL Quiz 2017
PPTX
Bazzinga Environment quiz 2017 finals with answers
PDF
Saahitya Science Fiction and Fantasy Quiz 2017 - Finals
PPTX
Anandotsava 2017, NMAMIT, Nitte General Quiz Finals
PDF
Geek Time Janvier 2017 : Java 8
PPTX
REVELS'17, MIT MANIPAL, INDIA QUIZ, FINALS
PPTX
Business quiz Final@ Marian College 2017
PPTX
Purvodaya 2017 Quizzard (Business Quiz) Finals, VGSOM, IIT Kharagpur
PDF
Geek Time Janvier 2017 : Angular 2
PPTX
Business Quiz
PPTX
In.Quiz.Itor General Quiz - Chowgule College Goa 2017
PPTX
LPU QUIZ CLUB presents Business Ka Badshah - The Biz. Quiz with Current Affairs.
PPTX
XCentricity Quiz 2017 By Apratim Chandra Singh
PPTX
Chaos 2017 India Quiz Finals
PPTX
India Quiz, Finals-Quizzathon'16, Manipal Institute Of Technology
PDF
Saahitya Science Fiction and Fantasy Quiz 2017 - Prelims
PDF
Geek Time December 2016 : Quiz Java 8
PPTX
KQA - Shankar PoLi, Poli Shankara and Kampni. Karnataka Quiz - 2017
PDF
LitSoc Main Quiz 2017 - Finals
PPTX
General quiz finals with answers
TSL Quiz 2017
Bazzinga Environment quiz 2017 finals with answers
Saahitya Science Fiction and Fantasy Quiz 2017 - Finals
Anandotsava 2017, NMAMIT, Nitte General Quiz Finals
Geek Time Janvier 2017 : Java 8
REVELS'17, MIT MANIPAL, INDIA QUIZ, FINALS
Business quiz Final@ Marian College 2017
Purvodaya 2017 Quizzard (Business Quiz) Finals, VGSOM, IIT Kharagpur
Geek Time Janvier 2017 : Angular 2
Business Quiz
In.Quiz.Itor General Quiz - Chowgule College Goa 2017
LPU QUIZ CLUB presents Business Ka Badshah - The Biz. Quiz with Current Affairs.
XCentricity Quiz 2017 By Apratim Chandra Singh
Chaos 2017 India Quiz Finals
India Quiz, Finals-Quizzathon'16, Manipal Institute Of Technology
Saahitya Science Fiction and Fantasy Quiz 2017 - Prelims
Geek Time December 2016 : Quiz Java 8
KQA - Shankar PoLi, Poli Shankara and Kampni. Karnataka Quiz - 2017
LitSoc Main Quiz 2017 - Finals
General quiz finals with answers
Ad

Similar to Geek Time Janvier 2017 : Quiz Java (20)

PPTX
Part - 2 Cpp programming Solved MCQ
PPTX
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
PPTX
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Feb-2021_L2_...
PDF
Starting Out with Java From Control Structures through Data Structures 3rd Ed...
PPTX
Technical aptitude test 2 CSE
PDF
1z0 851 exam-java standard edition 6 programmer certified professional
DOC
Sp 1418794917
PPT
Admission for b.tech
PPTX
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
DOCX
PPT
01_intro-cpp.ppt
PPT
01_intro-cpp.ppt
PPT
Ddp Cs3.0 Solar System
PPT
01_intro-cpjgknkhjgjv hugbbf vjouhghp.ppt
PPT
Introduction to data structure and algorithm
DOC
C++ questions
DOCX
Name _______________________________ Class time __________.docx
PDF
Computer Science Sample Paper 2
 
PPTX
11. Objects and Classes
PDF
Polymorphism, Abstarct Class and Interface in C#
Part - 2 Cpp programming Solved MCQ
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Feb-2021_L2_...
Starting Out with Java From Control Structures through Data Structures 3rd Ed...
Technical aptitude test 2 CSE
1z0 851 exam-java standard edition 6 programmer certified professional
Sp 1418794917
Admission for b.tech
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Mar-2021_L14...
01_intro-cpp.ppt
01_intro-cpp.ppt
Ddp Cs3.0 Solar System
01_intro-cpjgknkhjgjv hugbbf vjouhghp.ppt
Introduction to data structure and algorithm
C++ questions
Name _______________________________ Class time __________.docx
Computer Science Sample Paper 2
 
11. Objects and Classes
Polymorphism, Abstarct Class and Interface in C#

More from OLBATI (16)

PDF
Geek Time Juillet 2017 : TDD coté Front/JS
PDF
Geek Time Mai 2017 : Vue.js
PDF
Geek Time Juin 2017 : Microservices Tracing
PDF
Geek Time Juin 2017 : GraphQL
PDF
Geek Time Mars 2017 : Les microservices
PDF
Geek Time December 2016 : Bitcoin/Blockchain
PDF
Geek Time December 2016 : Swagger II
PDF
Geek Time Novembre 2016 : Quiz
PDF
Geek Time Novembre 2016 : Neo4j
PDF
Geek Time Novembre 2016 : Cucumber
PDF
Geek Time October 2016 : Coding Dojo - Calisthenics Objects
PDF
Geek Time September 2016 : Coding Dojo - Working on Legacy Code
PDF
Geek Time September 2016 : JavaScript Linting Tools
PDF
Geek Time Août 2016 : Docker
PDF
Geek Time Juin 2016 : Node.js
PDF
Geek Time Juin 2016 : React
Geek Time Juillet 2017 : TDD coté Front/JS
Geek Time Mai 2017 : Vue.js
Geek Time Juin 2017 : Microservices Tracing
Geek Time Juin 2017 : GraphQL
Geek Time Mars 2017 : Les microservices
Geek Time December 2016 : Bitcoin/Blockchain
Geek Time December 2016 : Swagger II
Geek Time Novembre 2016 : Quiz
Geek Time Novembre 2016 : Neo4j
Geek Time Novembre 2016 : Cucumber
Geek Time October 2016 : Coding Dojo - Calisthenics Objects
Geek Time September 2016 : Coding Dojo - Working on Legacy Code
Geek Time September 2016 : JavaScript Linting Tools
Geek Time Août 2016 : Docker
Geek Time Juin 2016 : Node.js
Geek Time Juin 2016 : React

Recently uploaded (20)

PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
medical staffing services at VALiNTRY
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
ai tools demonstartion for schools and inter college
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
System and Network Administraation Chapter 3
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Understanding Forklifts - TECH EHS Solution
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
How to Migrate SBCGlobal Email to Yahoo Easily
Design an Analysis of Algorithms II-SECS-1021-03
Operating system designcfffgfgggggggvggggggggg
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
medical staffing services at VALiNTRY
Odoo POS Development Services by CandidRoot Solutions
ai tools demonstartion for schools and inter college
Navsoft: AI-Powered Business Solutions & Custom Software Development
L1 - Introduction to python Backend.pptx
Introduction to Artificial Intelligence
CHAPTER 2 - PM Management and IT Context
System and Network Administraation Chapter 3
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution

Geek Time Janvier 2017 : Quiz Java

  • 1. Quiz Java Geek Time - Janvier 2017 Khaled HALLEB Consultant - OLBATI
  • 2. OLBATI © 2016 - Geek Time November 2016 2 Question 1 TreeMap class is used to implement which collection interface. Select the one correct answer A. Set B. SortedSet C. List D. Tree E. SortedMap
  • 3. OLBATI © 2016 - Geek Time November 2016 3 Question 2 Q2. How can you force garbage collection of an object? A. Garbage collection cannot be forced. B. Call System.gc(). C. Call System.gc() passing in a reference to the object to be garbage collected. D. Call Runtime.gc(). E. Set all references to the object to new values(null, for example).
  • 4. OLBATI © 2016 - Geek Time November 2016 4 Question 3 3. Given the following code: public class Example { public static void main(String args[]) { Date d1 = new Date (99, 11, 31); Date d2 = new Date (99, 11, 31); method(d1, d2); System.out.println("d1 is " + d1 + "nd2 is " + d2); } public static void method(Date d1, Date d2) { d2.setYear (100); d1 = d2; }} Which one or more of the following correctly describe the behavior when this program is compiled and run? a) compilation is successful and the output is: d1 is Fri December 31 00:00:00 GMT 1999 d2 is Fri December 31 00:00:00 GMT 1999 b) compilation is successful and the output is: d1 is Fri December 31 00:00:00 GMT 1999 d2 is Sun December 31 00:00:00 GMT 2000 c) compilation is successful and the output is: d1 is Sun December 31 00:00:00 GMT 2000 d2 is Sun December 31 00:00:00 GMT 2000 d) the assignment 'd1 = d2' is rejected by the compiler because the Date class cannot overload the operator '='. e) the expression (d1 is " + d1 + "nd2 is " + d2) is rejected by the compiler because the Date class cannot overload the operator '+'.
  • 5. OLBATI © 2016 - Geek Time November 2016 5 Réponse 1 TreeMap class is used to implement which collection interface. Select the one correct answer Correct Answer: E
  • 6. OLBATI © 2016 - Geek Time November 2016 6 Réponse 2 Q2. How can you force garbage collection of an object? Correct Answer: A
  • 7. OLBATI © 2016 - Geek Time November 2016 7 Réponse 3 3. Given the following code: public class Example { public static void main(String args[]) { Date d1 = new Date (99, 11, 31); Date d2 = new Date (99, 11, 31); method(d1, d2); System.out.println("d1 is " + d1 + "nd2 is " + d2); } public static void method(Date d1, Date d2) { d2.setYear (100); d1 = d2; }} Correct Answer: B
  • 8. OLBATI © 2016 - Geek Time November 2016 8 Thanks ! Any questions ? khaled.halleb@olbati.com