• الصفحة الرئيسية
  • إتصل بنا
  • سياسة الخصوصية
Logo
  • الرئيسية
  • أفكار
  • صحة
  • معلومات
  • عجائب وغرائب
  • تكنولوجيا
الصفحة الرئيسية Java Multiple Choice Question (MCQ) MCQ on Core Java with Answers set-1

MCQ on Core Java with Answers set-1

الكاتب ahmed في 1:04 AM Java Multiple Choice Question (MCQ)

1. Which exception is thrown by the read( ) method of input stream class?

A) Exception

B) ClassNotFoundException

C) read Exception

D) IOException



2. What garbage collection in the context of java?

A) The operating system periodically deletes all of the java files available on the system.

B) Any package imported in a program and not used in automatically deleted.

C) When all references to an object are gone, the memory used by the object is automatically reclaimed.

D) The JVM checks the output of any Java program and deletes anything that doesn't make sense.



3. In order for a source code file, containing the public class test, to successfully compile, which of the following must be true?

A) It must have a package statement

B) It must be named test.java

C) It must import java.lang

D) It must declare a public class named test.



4. Which of the following are true about the Error and Exception classes?

A) Both classes extend throwable

B) The error class is final and exception class is not.

C) The Exception class is final and the Error is not.

D) Both classes implement Throwable



5. Which of the following are true?

A) The void class extends the class class

B) The float class extends double class

C) The system class extends the runtime class

D) The integer class extends the number class



6. How do you create a Reader object from an InputStream object?

A) Use the static createReader() method of InputStream class

B) Use the static createReader() method of Reader class

C) Create an InputStreamReader object passing the InputStream object an an argument to the InputStreamReader constructor.

D) Create an OutputStreamReader object, passing the InputStream object as an argument to the OutputStreamReader constructor.



7. Which of the following is true?

A) The event inheritance model has replaced the event delegation model

B) The event inheritance model is more efficient than event delegation model

C) The event delegation model uses event listeners to define the methods of event handling classes.

D) The event delegation model uses the handleEvent() method to support event handling.



8. Which of the following is the highest class in the event delegation model?

A) java.util.EventListner

B) java.util.EventObject

C) java.util.AWTEvent

D) java.util.event.AWTEvent



9. When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?

A) The first object that was added as listner.

B) The last object that was added as listner

C) There is no way to determine which listener will be invoked first.

D) It is impossible to have more than one listener for a given event.



10. Suppose that you want to have an object eh handle the TextEvent of TextArea object t. How should you add eh as the event handler for?

A) t.addTextListener(eh);

B) eh.addTextListner(t);

C) addTextListner(eh.t);

D) addTextListner(t,eh);



11. What is the preferred way to handle an object's events in Java 2?

A) Override the object's handleEvent( ) method.

B) Add one or more event listeners to handle the events

C) Have the object override its process Event( ) methods.

D) Have the object override its dispatch Event( ) methods.



12. Which component method is used to access a component's immediate container?

A) getVisible()

B) getImmediate()

C) getParent()

D) getContainer()



13. Which of the following creates a List with 5 visible items and multiple selection enabled?

A) new List(5, true)

B) new List(true, 5)

C) new List(5, false)

D) new List(false, 5)



14. An Applet has its Layout Manager set to the default of FlowLayout. What code would be the correct to change to another Layout Manager?

A) setLayoutManager(new GridLayout());

B) setLayout(new GridLayout(2,2));

C) setGridLayout(2,2);

D) setBorderLayout();



15. How do you change the current layout manager for a container?

A) Use the setLayout method.

B) Once created you cannot change the current layout manager of a component

C) Use the setLayoutManager method.

D) Use the updateLayout method.



16. Which of the following methods can be used to draw the outline of a square within a JAVA.awt.Component object?

A) drawLine()

B) fillRect()

C) drawPolygon()

D) drawPolygon()



17. State true or false

i) JPanel is a class included in awt package

ii) Anonymous classes are mostly used for event handling

iii) Names of anonymous classes must be unique

iv) JOptionPane is an inner class

A) i-false, ii-false, iii-true, iv-true

B) i-true, ii-false, iii-true, iv-false

C) i-false, ii-true, iii-false, iv-false

D) i-true, ii-true, iii-false, iv-true



18. State true or false

i) Java RMI supports distributed objects written entirely in java

ii) Java RMI makes use of stubs and skeleton

iii) In Java RMI an object registers itself with a media server

iv) IDL is interface declaration language

A) True, True, False, False

B) False, True, True, True

C) True, False, True, False

D) True, True, True, True



19. Match the following

a) Datagram Socket        i) UDP connection

b) URL                           ii) provides necessary framework of debugging java programs

c) java.net                      iii) makes it possible to communicate over a network with java programs

d) sun.tools.debug          iv) is a java object that represent WWW address

A) a-i, b-iv, c-iii, d-ii

B) a-i, b-iv, c-ii, d-iii

C) a-ii, b-iii, c-i, d-iv

D) a-ii, b-i, c-iii, d-iv



20. State true or false

i) public can only be assigned to class

ii) protected protects a statement

iii) protected method is never accessible outside the package

iv) friendly variable may be accessible outside class

A) True, True, False, True

B) False, False, False, True

C) False, True, False, False

D) True, False, False, False


View Answers:


1. D) IOException
2. C) When all references to an object are gone, the memory used by the object is automatically reclaimed
3. B) It must be named test.java
4. A) Both classes extend throwable
5. D) The integer class extends the number class
6. C) Create an InputStreamReader object passing the InputStream object an an argument to the InputStreamReader constructor.
7. C) The event delegation model uses event listeners to define the methods of event handling classes.
8. B) java.util.EventObject
9. C) There is no way to determine which listener will be invoked first.
10. D) addTextListner(t,eh);
11. B) Add one or more event listeners to handle the events
12. C) getParent()
13. A) new List(5, true)
14. B) setLayout(new GridLayout(2,2));
15. A) Use the setLayout method
16. A) drawLine()
17. C) i-false, ii-true, iii-false, iv-false
18. A) True, True, False, False
19. A) a-i, b-iv, c-iii, d-ii
20. A) True, True, False, True




Related Posts:



  • Solved MCQ of Java Set-1
  • MCQ of Java with answer set-2
  • Solved MCQ of Java for Java Proficiency test set-3
  • Solved MCQ of Java set-4
  • Java MCQ Questions and Answers set-5
  • Java Multiple Choice Questions With Answers set-6
  • MCQ of Java With Answer set-7
  • Java Multiple Choice Questions With Answers set-8
  • Java Objective Questions with Answers set-9
  • Java MCQ Interview Questions With Answers set-10
  • MCQ on Java Programming Language Fundamental set-12 
شارك المقال :
Tweet
✚

مقالات ذات صلة

التالي
المشاركةالتالية
السابق
المشاركة السابقة

تحويل كودإخفاء محول الأكواد الإبتساماتإخفاء

شكرا لمشاركتنا رأيك
Subscribe to: Post Comments (Atom)
  • Facebook
  • twitter
  • googleplus
  • youtube
  • linkedin

الأكثر زيارة

  • What is Information ?
    Information  can be defined as data that has been processed into a form that is meaningful to the recipient and is of real or perceived valu...
  • What is Information Technology?
    Definitions of  Information technology  ( IT ) It is a branch of engineering dealing with the use of computers and telecommunications equipm...
  • بالصور الفائزة بمسابقة ملكة جمال مصر 2017
    بالصور الفائزة بمسابقة ملكة جمال مصر 2017
    بالصور الفائزة بمسابقة ملكة جمال مصر 2017 لن تصدق من هي فرح صدقي ↓↓  لمشاهدة الصور والخبر كامل اضغط هنا  ↓↓ رابط المو...
  • Interview Questions on Stack and Queue in Data Structure set-2
    1) The queue in which the insertion takes place in the first position after of last element is a ...... A. priority B. dequeue C. circular D...
  • List of Top 65 Search Engine Submission Add URLs.
    List of Top 65 Search Engine Submission Add URLs.
    To get your site on the top ranking on the search engine results, Your site or URL must be indexed by Search Engines. For that you have to s...
  • List of Best Keyword Research Tools for Better SEO
    List of Best Keyword Research Tools for Better SEO
    Everyone needs to do keyword research work for the site before starting search engine optimization work as the first and most essential tas...
  • What are the different types of scheduling methods?
    Process scheduling is one way for a processor to handle n processes , by scheduling the execution process. Each process is executed one by ...
  • Solved MCQ on Database Backup and Recovery in DBMS set-1
    1) Which of the following is not a recovery technique? A. Deferred update B. Immediate update C. Two-phase commit D. Recovery management 2)C...
  • Solved MCQ on Distributed Database Transaction Management set-4
    1) Commit and rollback are related to .......... A. data integrity B. data consistency C. data sharing D. data security 2) The transaction w...
  • Solved MCQ on Fundamental of DBMS set-10
    1) Which of the following is not a characteristic of a relational database model? A. Table B. Tree like structure C. Complex logical relatio...

الأقسام

  • Artificial Intelligence(AI)
  • Backlinking
  • Basic IT
  • Best List
  • Blogging Tips
  • C
  • C#
  • C++
  • Computer Architecture
  • Computer Fundamental
  • Computer Security
  • Computer/IT Officer Exam
  • CSS
  • Data Mining and Warehousing
  • Data Recovery Tools
  • Data Structure
  • Database Management System
  • E-commerce
  • E-government
  • Internet & Web Designing
  • IT Law
  • IT Tips and Tricks
  • IT Tutorials
  • Java
  • JavaScript
  • Keyword Research Tools
  • MIS
  • Multiple Choice Question (MCQ)
  • Networking
  • Online Earning
  • Online IT Jobs
  • Operating System
  • Oracle Forms and Reports
  • Programming Guide
  • Programming Language
  • SEO
  • Social Networking Sites
  • Software Download
  • Software Engineering
  • System Analysis and Design
  • Top List
  • VB.Net
  • صحة
  • عجائب وغرائب

الأرشيف

  • ►  2017 (4)
    • ►  November (3)
    • ►  October (1)
  • ►  2016 (5)
    • ►  April (5)
  • ►  2015 (87)
    • ►  August (1)
    • ►  July (8)
    • ►  June (13)
    • ►  May (2)
    • ►  April (2)
    • ►  March (4)
    • ►  February (20)
    • ►  January (37)
  • ▼  2014 (77)
    • ►  December (31)
    • ►  November (4)
    • ►  September (4)
    • ▼  August (11)
      • Objective Questions of Data Structure with Answer ...
      • MCQ on Core Java with Answers set-1
      • MCQ on Java Programming Language Fundamental set-12
      • MCQ on Basic SQL Queries with Answers set-1
      • Solved MCQ on Database Normalization set-1
      • Solved MCQ on C++ Programming Language set-7
      • MCQ on c++ Programming with Answers set-6
      • objective type questions in c programming language...
      • Solved MCQ on C Programming Language set-5
      • MCQ on C Programming With Answers set-4
      • How to validate required field in a form using jav...
    • ►  July (8)
    • ►  June (2)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (7)
    • ►  January (4)
  • ►  2013 (132)
    • ►  December (11)
    • ►  November (6)
    • ►  October (4)
    • ►  September (6)
    • ►  August (16)
    • ►  July (9)
    • ►  June (9)
    • ►  May (12)
    • ►  April (13)
    • ►  March (23)
    • ►  February (6)
    • ►  January (17)
  • ►  2012 (59)
    • ►  December (15)
    • ►  November (20)
    • ►  October (21)
    • ►  September (3)

إنضم لنا

© 2017 أفكار جميع الحقوق محفوظة