SlideShare a Scribd company logo
www.javaassignmenthelp.net
List Of Best Java Multiple Choice Questions and
Answers
Advanced java multiple choice questions and answers will help you to be more
knowledgeable because they can give you ideas on questions and answers. Check out this page to
learn of the best Java multiple choice Q&As.
List of Advanced Java Multiple Choice Questions
Java swing multiple choice questions and answers are important to know, especially if you
want to pass. The questions will be your basis on what you need to learn.
1. Why Java and JavaScript have same name?
a) JavaScript works as a version stripped-down of the Java
b) Both are originated in island of the Java
c) Javacript’s syntax is based on the Java’s
www.javaassignmenthelp.net
Answer: c
2. If you will view the JavaScript page, which machine will execute the so-
called script?
a) Machine running the online browser
b) Central machine within the Netscapes corporate offices
c) Web server
Answer: a
3. ____JavaScript is referred as client-side.
a) Livewire
b) Native
c) Microsoft
Answer: a
4. What variables are being used in the programs for the JavaScript?
a) Dates, stroning numbers and others
b) Algebra flashbacks
c) Varying randomly
Answer: a
www.javaassignmenthelp.net
5. ____ JavaScript statement embedded in the HTML page responding to
the user events?
a) Server-side
b) Native
c) Client-side
Answer: c
6. In the end of the JavaScript, what will appear?
a) The <script>
b) The </script>
c) End statement
Answer: b
7. What cannot be done in the client-side of the JavaScript?
a) Storing forms contents to file database on server
b) Sending forms contents
c) Validating form
Answer: a
8. Which are the capabilities functions in the JavaScript?
a) Accept parameters
b) Return the value and accept parameters
c) Return the value
Answer: a
www.javaassignmenthelp.net
9. Which is invalid variable name of JavaScript?
a) First and last names
b) First and last
c) 2names
Answer: c
10.____ tag is the extension to the HTML enclosing number of the
JavaScript statement.
a) <SCRIPT>
b) <TITLE>
c) <HEAD>
Answer: a
11.How the JavaScript store dates in date object?
a) The number of the milliseconds since 1st January 1970
b) The number of the days since 1st January1900
c) No answer
Answer: a
12. Which attribute will able to hold JavaScript version?
a) LANGUAGE
b) VERSION
www.javaassignmenthelp.net
c) SCRIPT
Answer: a
13.What JavaScript syntax is correct in writing the "Hello World"?
a) println ("Hello World")
b) System.out.println("Hello World")
c) document.write("Hello World")
Answer: c
14.Which way can be used in indicating LANGUAGE attribute?
a) <SCRIPT LANGUAGE="JavaScriptVersion"!> JavaScript statements…</SCRIPT>
b) <SCRIPT LANGUAGE="JavaScriptVersion">
c) <SCRIPT LANGUAGE="JavaScriptVersion"> JavaScript statements…</SCRIPT>
Answer: c
15.In what HTML element you put JavaScript?
a) <js>
b) <scripting>
c) <script>
Answer: c
16.What correct syntax referring to the external script called " abc.js"?
a) <script href=" abc.js">
b) script src=" abc.js">
www.javaassignmenthelp.net
c) <script name=" abc.js”>
Answer: b
17.Which image maps types can be used with the JavaScript?
a) Server-side image maps
b) Server-side image maps and the Client-side image maps
c) Client-side image maps
Answer: c
18.Which navigator object properties is the same in both IE and Netscape?
a) navigator.appCodeName
b) navigator.appVersion
c) navigator.appName
Answer: a
19.Correct way in writing the JavaScript array?
a) var txt = new Array("tim","kim","jim")
b) var txt = new Array:1=("tim")2=("kim")3=("jim")
c) var txt = new Array="tim","kim","jim"
Answer: a
www.javaassignmenthelp.net
20.What does <noscript> tag do?
a) Enclose text that to be displayed by the non-JavaScript browsers
b) Describes certain low-budget movies.
c) Prevents scripts on page from executing.
Answer: a
21. If para1 is DOM object for a paragraph, then what is the correct syntax
in changing text within the paragraph?
a) para1.value="New Text";
b) "New Text"?
c) para1.nodeValue="New Text";
Answer: a
22.JavaScript entities begin with the _______ and end with the _________.
a) Semicolon, colon
b) Ampersand, colon
c) Ampersand, semicolon
Answer: c
23.Which best describes the JavaScript?
a) a scripting language precompiled in the browser.
b) a compiled scripting language.
c) an object-oriented scripting language.
Answer: b
www.javaassignmenthelp.net
24.Choose the JavaScript object server-side?
a) File
b) Date
c) FileUpLoad
Answer: a
25.Choose the client-side JavaScript object?
a) Database
b) Client
c) FileUpLoad
Answer: c
26.Which is not considered as a JavaScript operator?
a) New
b) Delete
c) This
Answer: c
27. ______method evaluates the string of the JavaScript code in context of
the specified object.
a) Eval
b) Efloat
www.javaassignmenthelp.net
c) ParseFloat
Answer: a
28.Event fires when form element loses the focus: <button>, <input>,
<label>, <select>, <textarea>?
a) Onfocus
b) Onblur
c) Onclick
Answer: b
29.The syntax of the Eval is?
a) [objectName.]eval(numeriC.
b) [objectName.]eval(string)
c) [EvalName.]eval(string)
Answer: b
30.JavaScript is interpreted by the?
a) Server
b) Client
c) Object
Answer: b
www.javaassignmenthelp.net
31.In testing specific condition, you will use ___ statement.
a) Select
b) For
c) Switch
Answer: c
32.Which is structure of the if statement?
a) if (conditional expression is true) thenexecute this codeend if
b) if (conditional expression is true) {then execute this code>->}
c) if (conditional expression is true)execute this codeend if
Answer: b
33.How you create Date object in the JavaScript?
a) dateObjectName Date([parameters])
b) dateObjectName = new Date([parameters])
c) dateObjectName := new Date([parameters])
Answer: b
34._______ method of the Array object adds and/or removes elements from
the array.
a) Reverse
b) Splice
c) Slice
Answer: b
www.javaassignmenthelp.net
35.In setting up window to capture click events, what do you use?
a) window.captureEvents(Event.CLICK);
b) window.handleEvents (Event.CLICK);
c) window.routeEvents(Event.CLICK );
Answer: a
36.Which tag can handle the mouse events in the Netscape?
a) <A>
b) <BR>
Answer: a
37. ____________ is tainted property of window object.
a) Pathname
b) Host
c) Defaultstatus
Answer: c
38.In enabling data tainting, end user sets ____ environment variable.
a) ENABLE_TAINT
b) NS_ENABLE_TAINT
c) ENABLE_TAINT_NS
Answer: b
www.javaassignmenthelp.net
39.In JavaScript, the _________ is object of target language data type
enclosing the object of source language.
a) a form
b) a wrapper
c) a cursor
Answer: b
40.When the JavaScript object is being sent to the Java, the runtime engine
will create a Java wrapper of what type?
a) ScriptObject
b) JavaObject
c) JSObject
Answer: c
41.The _______ class is providing interface that invokes JavaScript
methods as well as examining JavaScript properties.
a) ScriptObject
b) JSObject
c) Jobject
Answer: b
www.javaassignmenthelp.net
42.The _________ is a wrapped Java array that accessed from JavaScript
code.
a) JavaPackage
b) JavaArray
c) JavaObject
Answer: b
43.The ________ object is reference to 1 of classes in the Java package like
netscape.javascript .
a) JavaClass
b) JavaPackage
c) JavaObject
Answer: a
44.JavaScript exception is available to Java code as instance of?
a) netscape.javascript.JSObject
b) netscape.plugin.JSException
c) netscape.javascript.JSException
Answer: c
45.To automatically open console if a JavaScript mistake occurs which is
added to the prefs.js?
a) user_pref(" javascript.console.open_on_error", false);
b) user_pref("javascript.console.open_on_error", true);
www.javaassignmenthelp.net
c) user_pref("javascript.console.open_error ", false);
Answer: c
46.In order to open the dialog box every time a mistake occurs, which is
added to prefs.js?
a) user_pref("javascript.classic.error_alerts", true);
b) user_pref("javascript.console.open_on_error ", false);
c) user_pref("javascript.classic.error_alerts ", false);
Answer: a
47.Syntax of the blur method in the button object is?
a) Blur(value)
b) Blur()
c) Blur(depth)
Answer: b
48.Syntax of the capture events method for a document object is?
a) captureEvents()
b) captureEvents(args eventType)
c) captureEvents(eventType)
Answer: c
www.javaassignmenthelp.net
49.Syntax of the close method for a document object is?
a) Close(doC.
b) Close(object)
c) Close()
Answer: c
50.<script type="text/javascript">
x=4+"4";
document.write(x);
</script>
the output is ?
a) 4
b) 8
c) 44
Answer: c
51.It is possible to nest functions in the JavaScript?
a) True
b) False
Answer: a
www.javaassignmenthelp.net
52.<script>
document.write(navigator.appCodeName);
</script>
a) get code name of the browser of a visitor
b) set code name of the browser of a visitor
Answer: a
53.Scripting language are?
a) High Level Programming language
b) Machine level programming language
Answer: a
54.Which explains getSelection()?
a) Returns VALUE of a selected OPTION..
b) Returns value of cursor-selected text
c) Returns VALUE of a checked radio input
Answer: b
55.Choose the client-side JavaScript object:
a) Database
b) Cursor
c) FileUpLoad
Answer: c
www.javaassignmenthelp.net
56.Define the meaning of "this" keyword in the javascript?
a) It refers to the current object
b) It’s variable containing value
c) It refers to the previous object
Answer: a
57.In JavaScript, Window.prompt() method return true or false value ?
a) False
b) True
Answer: a
58.<script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script>
a) 258
b) Error
c) 7
d) 78
Answer: d
www.javaassignmenthelp.net
59.<script type="text/javascript">
var s = "9123456 or 80000?";
var pattern = /d{4}/;
var output = s.match(pattern);
document.write(output);
</script>
a) 9123
b) 91234
c) 80000
Answer: a
60.Test and tags are not displayed directly on page are written in _____
section.
a) <html>
b) <head>
c) <title>
d) <body>
Answer: b
61.Which tag inserts a line horizontally on web page?
a) <hr>
b) <line>
c) <line direction=”horizontal”>
d) <tr>
Answer: a
www.javaassignmenthelp.net
62.What should be the first tag in the HTML document?
a) <head>
b) <title>
c) <html>
d) <document>
Answer: c
63.The JDBC-ODBC bridge allows _______to be used as________.
a) ODBC drivers, JDBC drivers
b) Application, drivers
c) ODBC drivers, JDBC drivers
d) drivers, application
Answer: c
64. Which is true about Java.
a) Java doesn’t support the overloading.
b) Java has replaced the destructor function of the C++
c) There are no any header files in the Java.
d) All of the above.
Answer: d
www.javaassignmenthelp.net
65. ______are not machine instructions and the Java interpreter generate
machine codes that is directly executed by machine running the Java
program.
a) Compiled Instructions
b) Compiled code
c) byte code
d) Java mid code
Answer: c
66. The command javac
a) Converts the java program to binary code
b) Converts the java program to bytecode
c) Converts the java program to machine language
Answer: b
67. Which is not primitive type of Java
a) Float
b) Byte
c) Character
d) Long double
Answer: d
www.javaassignmenthelp.net
68.Command to execute compiled java program is?
a) java
b) run
c) javac
d) javaw
Answer: a
69.Java Servlet?
i) is key component of server side java development
ii) is a small pluggable extension to a server that enhances functionality
iii) runs only in Windows Operating System
iv) allows developers to customize any java enabled server
a) i, ii & iii are ture
b) i, iii & iv are true
c) ii, iii & iv are true
d) i, ii & iv are true()
Answer: d
70.Inner classes are?
a) anonymous classes
b) nested classes
c) sub classes
www.javaassignmenthelp.net
d) derived classes
Answer: b
71.How many times does code segment execute
int x=1, y=10, z=1;
do{y--; x++; y-=2; y=z; z++} while (y>1 && z<10);
a) 1
b) 10
c) 5
d) infinite
Answer: a
72.State if the statement is true or false for EJB.
1. EJB exists in the middle-tier()
2. EJB specifies an execution environment
3. EJB supports transaction processing
a) 1-true, 2. true, 3. true
b) 1- true, 2. false, 3. true
c) 1- false, 2- false, 3- false
d) 1-true, 2-true, 3-false
Answer: a
www.javaassignmenthelp.net
73.Prepared statement object in the JDBC is being used to ins executing
____ queries.
a) Executable
b) simple
c) high level
d) parameterized
Answer: d
74. In JDBC, ____ imports all Java classes that is concerned with the
database connectivity.
a)javax.sql.*
b)java.mysql.*
c)java.sql.*
d) com.*
Answer: c
75. MS-SQL is storing data in _____ file format.
a) .DAT
b) .MDB
c) .MSSQL
d) .OBJ
Answer: a
76. Ingres is a?
a) Socket
b) Compiler
c) Database
www.javaassignmenthelp.net
d) Web server
Answer: c
77. In Java servlet method init( ) is called ______ times.
a) 1
b) 2
c) 0
d) multiple
Answer: a
78. State if it is true or false for Java Program.
i) All class variables are instance variables
ii) All protected methods are friendly methods
a) i-false, ii-false
b) i-false, ii-true
c) i-true, ii-false
d) i-true, ii-true
Answer: b
79. State true or false for Java Program.
i) Data members of an interface are by default final
ii) An abstract class has implementations of all methods defined inside it.
a) i-false, ii-false
b) i-false, ii-true
c) i-true, ii-false
d) i-true, ii-true
Answer: c
80. The _____ of remotely accessible object should implement?
a) all methods, RemoteException
www.javaassignmenthelp.net
b) class, RemoteException
c) class, RemoteInterface
d) all methods, RemoteInterface
Answer: c
81. The ____is the key to______.
a) Serialization, persistence
b) Persistence, inheritance
c) Inheritance, object
d) Persistence, serialization
Answer: a
82. A method name myMethod( ) that needs 2 integer arguments is declared
as?
a) public void myMethod( );
b) public void myMethod(int a, int b);
c) public void myMethod(int a, b);
d) public int myMethod(a, b);
Answer: b
83. JSP embeds in_____ in _____.
a) Servlet, HTML
b) HTML, Java
c) HTML, Servlet
d) Java, HTML
Answer: d
84. The class at top of the exception class hierarchy is?
www.javaassignmenthelp.net
a) ArithmeticException
b) Throwable
c) Class
d) Exception
Answer: b
85. In the java program, the package declaration ____ import statements.
a) must precede
b) must succeed
c) may precede or succeed
d) none
Answer: a
86. Class string belongs to the ____package.
a) java.awt
b) java.lang
c) java.applet
d) java.string
Answer: d
87. ______package is being used by the compiler itself. So, it doesn’t need to
be imported for use.
a) java.math
b) java.awt
www.javaassignmenthelp.net
c) java.applet
d) java.lang
Answer: d
88. State if it is true or false.
i) Java beans slow down software development process.
ii) Java Servlets does not have built in multithreading feature.
a) i-false, ii-false
b) i-false, ii-true
c) i-true, ii-false
d) i-true, ii-true
Answer: a
89. State if it is true or false.
i) init( ) of servlet is called after a client request comes in
ii) Servlets are ultimately converted into JSP
a) i-false, ii-false
b) i-false, ii-true
c) i-true, ii-false
d) i-true, ii-true
Answer: a
www.javaassignmenthelp.net
90. What will be the result of compiling following code.
public class MyClass{
public static void main(String args[]){
System.out.println("In first main()");
}
public static void main(char args[]){
System.out.println('a');
}
}
a) Code will not compile and will give "Duplicate main() method declaration" error
b) Code will compile correctly but will give a runtime exception
c) Code will compile correctly and will print "In first main()" (without quotes) when it is run
d) Code will compile correctly and will print "a" (without quotes) when it is run
Answer: c
91. Match the following.
a) Java 1) is a tool for debugging java program
b) Javah 2) is a tool for creating C-like header files
c) Javap 3) runs java bytecode
d) jdb 4) prints java code representation
a) a-3, b-2,c-1
b) a-3, b-2, c-4, d-1
c) a-1, b-2, c-3, d-4
d) a-2, b-1, c-3, d-4
www.javaassignmenthelp.net
Answer: b
92. State if it is true or false.
i) init() is called after start() in applet
ii) applets are used for networking
iii) inheritance is a part of Java Foundation Classes
iv) final does not prevent inheritance
a) i-true, ii-true, iii-false, iv-true
b) i-false, ii-false, iii-false, iv-false
c) i-true, ii-true, iii-true, iv-true
d) i-true, ii-false, iii-false, iv-false
Answer: b
93. The ____and the ____classes are abstract classes supporting reading
and writing of the byte streams.
a) reader, writer
b) inputstream, outputstream
c) objectinputstream, objectoutputstream
d) none
Answer: b
94. What is error in the code?
class Test
{
abstract void display( );
}
www.javaassignmenthelp.net
a) No error
b) Method display( ) should be declared as static
c) Test class should be declared as abstract
d) Test class should be declared as public
Answer: c
95. A package is a collection of?
a) classes
b) interfaces
c) editing tools
d) classes and interfaces
Answer: d
96. Which methods belong to string class?
a) length( )
b) compare To ( )
c) equals ( )
d) All of them
Answer: d
97. What is the output of the code?
byte x=64, y;
y= (byte) (x<<2);
System.out.println(y);
a) 0
b) 1
c) 2
d) 64
Answer: a
www.javaassignmenthelp.net
98. If m and the n are int type variables, what is result of the expression
m%n
when m=5 and n=2 ?
a) 0
b) 1
c) 2
d) None of the above
Answer: b
99. Which of the control expressions are valid when it comes to if
statement?
a) An integer expression
b) A Boolean expression
c) Either A or B
d) Neither A nor B
Answer: b
100. The concept of the multiple inheritance is being implemented in the
Java by?
a) extending two or more classes
b) extending one class and implementing one or more interfaces
c) implementing two or more interfaces
d) both b and c
Answer: b
There you have java multiple choice interview questions that you may want to
practice with so that you can study and learn of Java. If you need Java
assignment help, feel free to contact us!

More Related Content

PDF
Methods in Java
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- bas...
PPTX
Raster scan systems with video controller and display processor
PPTX
Java String Handling
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
PDF
Introduction to php
PDF
C multiple choice questions and answers pdf
PPTX
Java Method, Static Block
Methods in Java
Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- bas...
Raster scan systems with video controller and display processor
Java String Handling
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Introduction to php
C multiple choice questions and answers pdf
Java Method, Static Block

What's hot (20)

PDF
JavaScript - Chapter 6 - Basic Functions
PPTX
graphics programming in java
PDF
Intermediate code generation
PPTX
Unit 5 java-awt (1)
PPT
Python GUI Programming
PPTX
Java Methods
PPT
Inheritance and Polymorphism
PPT
Thread model in java
PPTX
Java packages
PPTX
Session tracking in servlets
PPTX
Event Handling in java
PPT
Java Networking
PPTX
Java abstract class & abstract methods
PPT
Abstract class
PPT
RichControl in Asp.net
PPTX
[OOP - Lec 08] Encapsulation (Information Hiding)
PDF
Java I/o streams
PPTX
Two-dimensional array in java
PPTX
GUI components in Java
PPTX
JavaScript - Chapter 6 - Basic Functions
graphics programming in java
Intermediate code generation
Unit 5 java-awt (1)
Python GUI Programming
Java Methods
Inheritance and Polymorphism
Thread model in java
Java packages
Session tracking in servlets
Event Handling in java
Java Networking
Java abstract class & abstract methods
Abstract class
RichControl in Asp.net
[OOP - Lec 08] Encapsulation (Information Hiding)
Java I/o streams
Two-dimensional array in java
GUI components in Java
Ad

Viewers also liked (20)

DOCX
Java mcq
PDF
Java apptitude-questions-part-2
PDF
Solved Question Paper of Computer Operator Examination Conducted by EPF 2016
PPTX
Stripline
PDF
Java Programming Basics
PDF
Java apptitude-questions-part-1
PDF
Java (Information Technology) Question paper for T.Y Bca
PDF
History of computers mcq
PDF
Generation of computers mcq
PDF
JAVA Programming Questions and Answers PART III
DOCX
Vani Bio Data
PDF
Computer systems mcq
PDF
Ibps sbi po computer awareness mega question bank of 1500 questions
PDF
Computer hardware concepts mcq paper
DOC
Biodata format for marriage word 6 95 - 97 - 2003
PDF
Electronic devices-and-circuit-theory-10th-ed-boylestad-chapter-5
PDF
Strip lines
DOCX
BIODATA-1
PDF
Electronic devices-and-circuit-theory-10th-ed-boylestad-chapter-16
DOCX
Bio data
Java mcq
Java apptitude-questions-part-2
Solved Question Paper of Computer Operator Examination Conducted by EPF 2016
Stripline
Java Programming Basics
Java apptitude-questions-part-1
Java (Information Technology) Question paper for T.Y Bca
History of computers mcq
Generation of computers mcq
JAVA Programming Questions and Answers PART III
Vani Bio Data
Computer systems mcq
Ibps sbi po computer awareness mega question bank of 1500 questions
Computer hardware concepts mcq paper
Biodata format for marriage word 6 95 - 97 - 2003
Electronic devices-and-circuit-theory-10th-ed-boylestad-chapter-5
Strip lines
BIODATA-1
Electronic devices-and-circuit-theory-10th-ed-boylestad-chapter-16
Bio data
Ad

Similar to Java Multiple Choice Questions and Answers (20)

DOCX
Top Javascript Q's
DOC
PDF
JavaScript MCQ (JS Coding Questions and Answers)
PDF
Top 40 Javascript Interview Questions and Answers.pdf
XLS
Lt web quiz_answer
PDF
HTML and JavaScript BASICS 4th Edition Barksdale Test Bank
PDF
Maharashtra state board Hsc IT Chap 3.pdf
PPTX
Javascript MCQ
PDF
JavaScript Interview Questions with Answers
DOCX
Javascript viva questions
PDF
656981533-100-JavaScript-Interview-QnA.pdf
PPTX
Mcq Of Java Script ppt for Teaching and self preparation
PPTX
Web designing unit 4
PPTX
Java script
PPTX
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
PPT
JavaScript - An Introduction
PDF
Java MCQ Important Questions and Answers
PPTX
Chapter 3 INTRODUCTION TO JAVASCRIPT S.pptx
PDF
Lecture7
Top Javascript Q's
JavaScript MCQ (JS Coding Questions and Answers)
Top 40 Javascript Interview Questions and Answers.pdf
Lt web quiz_answer
HTML and JavaScript BASICS 4th Edition Barksdale Test Bank
Maharashtra state board Hsc IT Chap 3.pdf
Javascript MCQ
JavaScript Interview Questions with Answers
Javascript viva questions
656981533-100-JavaScript-Interview-QnA.pdf
Mcq Of Java Script ppt for Teaching and self preparation
Web designing unit 4
Java script
MYSQL DATABASE INTRODUCTION TO JAVASCRIPT.pptx
JavaScript - An Introduction
Java MCQ Important Questions and Answers
Chapter 3 INTRODUCTION TO JAVASCRIPT S.pptx
Lecture7

Recently uploaded (20)

PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
master seminar digital applications in india
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Basic Mud Logging Guide for educational purpose
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
TR - Agricultural Crops Production NC III.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
master seminar digital applications in india
Anesthesia in Laparoscopic Surgery in India
102 student loan defaulters named and shamed – Is someone you know on the list?
STATICS OF THE RIGID BODIES Hibbelers.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Complications of Minimal Access Surgery at WLH
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Basic Mud Logging Guide for educational purpose
O7-L3 Supply Chain Operations - ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Microbial disease of the cardiovascular and lymphatic systems
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
VCE English Exam - Section C Student Revision Booklet
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
TR - Agricultural Crops Production NC III.pdf

Java Multiple Choice Questions and Answers

  • 1. www.javaassignmenthelp.net List Of Best Java Multiple Choice Questions and Answers Advanced java multiple choice questions and answers will help you to be more knowledgeable because they can give you ideas on questions and answers. Check out this page to learn of the best Java multiple choice Q&As. List of Advanced Java Multiple Choice Questions Java swing multiple choice questions and answers are important to know, especially if you want to pass. The questions will be your basis on what you need to learn. 1. Why Java and JavaScript have same name? a) JavaScript works as a version stripped-down of the Java b) Both are originated in island of the Java c) Javacript’s syntax is based on the Java’s
  • 2. www.javaassignmenthelp.net Answer: c 2. If you will view the JavaScript page, which machine will execute the so- called script? a) Machine running the online browser b) Central machine within the Netscapes corporate offices c) Web server Answer: a 3. ____JavaScript is referred as client-side. a) Livewire b) Native c) Microsoft Answer: a 4. What variables are being used in the programs for the JavaScript? a) Dates, stroning numbers and others b) Algebra flashbacks c) Varying randomly Answer: a
  • 3. www.javaassignmenthelp.net 5. ____ JavaScript statement embedded in the HTML page responding to the user events? a) Server-side b) Native c) Client-side Answer: c 6. In the end of the JavaScript, what will appear? a) The <script> b) The </script> c) End statement Answer: b 7. What cannot be done in the client-side of the JavaScript? a) Storing forms contents to file database on server b) Sending forms contents c) Validating form Answer: a 8. Which are the capabilities functions in the JavaScript? a) Accept parameters b) Return the value and accept parameters c) Return the value Answer: a
  • 4. www.javaassignmenthelp.net 9. Which is invalid variable name of JavaScript? a) First and last names b) First and last c) 2names Answer: c 10.____ tag is the extension to the HTML enclosing number of the JavaScript statement. a) <SCRIPT> b) <TITLE> c) <HEAD> Answer: a 11.How the JavaScript store dates in date object? a) The number of the milliseconds since 1st January 1970 b) The number of the days since 1st January1900 c) No answer Answer: a 12. Which attribute will able to hold JavaScript version? a) LANGUAGE b) VERSION
  • 5. www.javaassignmenthelp.net c) SCRIPT Answer: a 13.What JavaScript syntax is correct in writing the "Hello World"? a) println ("Hello World") b) System.out.println("Hello World") c) document.write("Hello World") Answer: c 14.Which way can be used in indicating LANGUAGE attribute? a) <SCRIPT LANGUAGE="JavaScriptVersion"!> JavaScript statements…</SCRIPT> b) <SCRIPT LANGUAGE="JavaScriptVersion"> c) <SCRIPT LANGUAGE="JavaScriptVersion"> JavaScript statements…</SCRIPT> Answer: c 15.In what HTML element you put JavaScript? a) <js> b) <scripting> c) <script> Answer: c 16.What correct syntax referring to the external script called " abc.js"? a) <script href=" abc.js"> b) script src=" abc.js">
  • 6. www.javaassignmenthelp.net c) <script name=" abc.js”> Answer: b 17.Which image maps types can be used with the JavaScript? a) Server-side image maps b) Server-side image maps and the Client-side image maps c) Client-side image maps Answer: c 18.Which navigator object properties is the same in both IE and Netscape? a) navigator.appCodeName b) navigator.appVersion c) navigator.appName Answer: a 19.Correct way in writing the JavaScript array? a) var txt = new Array("tim","kim","jim") b) var txt = new Array:1=("tim")2=("kim")3=("jim") c) var txt = new Array="tim","kim","jim" Answer: a
  • 7. www.javaassignmenthelp.net 20.What does <noscript> tag do? a) Enclose text that to be displayed by the non-JavaScript browsers b) Describes certain low-budget movies. c) Prevents scripts on page from executing. Answer: a 21. If para1 is DOM object for a paragraph, then what is the correct syntax in changing text within the paragraph? a) para1.value="New Text"; b) "New Text"? c) para1.nodeValue="New Text"; Answer: a 22.JavaScript entities begin with the _______ and end with the _________. a) Semicolon, colon b) Ampersand, colon c) Ampersand, semicolon Answer: c 23.Which best describes the JavaScript? a) a scripting language precompiled in the browser. b) a compiled scripting language. c) an object-oriented scripting language. Answer: b
  • 8. www.javaassignmenthelp.net 24.Choose the JavaScript object server-side? a) File b) Date c) FileUpLoad Answer: a 25.Choose the client-side JavaScript object? a) Database b) Client c) FileUpLoad Answer: c 26.Which is not considered as a JavaScript operator? a) New b) Delete c) This Answer: c 27. ______method evaluates the string of the JavaScript code in context of the specified object. a) Eval b) Efloat
  • 9. www.javaassignmenthelp.net c) ParseFloat Answer: a 28.Event fires when form element loses the focus: <button>, <input>, <label>, <select>, <textarea>? a) Onfocus b) Onblur c) Onclick Answer: b 29.The syntax of the Eval is? a) [objectName.]eval(numeriC. b) [objectName.]eval(string) c) [EvalName.]eval(string) Answer: b 30.JavaScript is interpreted by the? a) Server b) Client c) Object Answer: b
  • 10. www.javaassignmenthelp.net 31.In testing specific condition, you will use ___ statement. a) Select b) For c) Switch Answer: c 32.Which is structure of the if statement? a) if (conditional expression is true) thenexecute this codeend if b) if (conditional expression is true) {then execute this code>->} c) if (conditional expression is true)execute this codeend if Answer: b 33.How you create Date object in the JavaScript? a) dateObjectName Date([parameters]) b) dateObjectName = new Date([parameters]) c) dateObjectName := new Date([parameters]) Answer: b 34._______ method of the Array object adds and/or removes elements from the array. a) Reverse b) Splice c) Slice Answer: b
  • 11. www.javaassignmenthelp.net 35.In setting up window to capture click events, what do you use? a) window.captureEvents(Event.CLICK); b) window.handleEvents (Event.CLICK); c) window.routeEvents(Event.CLICK ); Answer: a 36.Which tag can handle the mouse events in the Netscape? a) <A> b) <BR> Answer: a 37. ____________ is tainted property of window object. a) Pathname b) Host c) Defaultstatus Answer: c 38.In enabling data tainting, end user sets ____ environment variable. a) ENABLE_TAINT b) NS_ENABLE_TAINT c) ENABLE_TAINT_NS Answer: b
  • 12. www.javaassignmenthelp.net 39.In JavaScript, the _________ is object of target language data type enclosing the object of source language. a) a form b) a wrapper c) a cursor Answer: b 40.When the JavaScript object is being sent to the Java, the runtime engine will create a Java wrapper of what type? a) ScriptObject b) JavaObject c) JSObject Answer: c 41.The _______ class is providing interface that invokes JavaScript methods as well as examining JavaScript properties. a) ScriptObject b) JSObject c) Jobject Answer: b
  • 13. www.javaassignmenthelp.net 42.The _________ is a wrapped Java array that accessed from JavaScript code. a) JavaPackage b) JavaArray c) JavaObject Answer: b 43.The ________ object is reference to 1 of classes in the Java package like netscape.javascript . a) JavaClass b) JavaPackage c) JavaObject Answer: a 44.JavaScript exception is available to Java code as instance of? a) netscape.javascript.JSObject b) netscape.plugin.JSException c) netscape.javascript.JSException Answer: c 45.To automatically open console if a JavaScript mistake occurs which is added to the prefs.js? a) user_pref(" javascript.console.open_on_error", false); b) user_pref("javascript.console.open_on_error", true);
  • 14. www.javaassignmenthelp.net c) user_pref("javascript.console.open_error ", false); Answer: c 46.In order to open the dialog box every time a mistake occurs, which is added to prefs.js? a) user_pref("javascript.classic.error_alerts", true); b) user_pref("javascript.console.open_on_error ", false); c) user_pref("javascript.classic.error_alerts ", false); Answer: a 47.Syntax of the blur method in the button object is? a) Blur(value) b) Blur() c) Blur(depth) Answer: b 48.Syntax of the capture events method for a document object is? a) captureEvents() b) captureEvents(args eventType) c) captureEvents(eventType) Answer: c
  • 15. www.javaassignmenthelp.net 49.Syntax of the close method for a document object is? a) Close(doC. b) Close(object) c) Close() Answer: c 50.<script type="text/javascript"> x=4+"4"; document.write(x); </script> the output is ? a) 4 b) 8 c) 44 Answer: c 51.It is possible to nest functions in the JavaScript? a) True b) False Answer: a
  • 16. www.javaassignmenthelp.net 52.<script> document.write(navigator.appCodeName); </script> a) get code name of the browser of a visitor b) set code name of the browser of a visitor Answer: a 53.Scripting language are? a) High Level Programming language b) Machine level programming language Answer: a 54.Which explains getSelection()? a) Returns VALUE of a selected OPTION.. b) Returns value of cursor-selected text c) Returns VALUE of a checked radio input Answer: b 55.Choose the client-side JavaScript object: a) Database b) Cursor c) FileUpLoad Answer: c
  • 17. www.javaassignmenthelp.net 56.Define the meaning of "this" keyword in the javascript? a) It refers to the current object b) It’s variable containing value c) It refers to the previous object Answer: a 57.In JavaScript, Window.prompt() method return true or false value ? a) False b) True Answer: a 58.<script language="javascript"> function x() { document.write(2+5+"8"); } </script> a) 258 b) Error c) 7 d) 78 Answer: d
  • 18. www.javaassignmenthelp.net 59.<script type="text/javascript"> var s = "9123456 or 80000?"; var pattern = /d{4}/; var output = s.match(pattern); document.write(output); </script> a) 9123 b) 91234 c) 80000 Answer: a 60.Test and tags are not displayed directly on page are written in _____ section. a) <html> b) <head> c) <title> d) <body> Answer: b 61.Which tag inserts a line horizontally on web page? a) <hr> b) <line> c) <line direction=”horizontal”> d) <tr> Answer: a
  • 19. www.javaassignmenthelp.net 62.What should be the first tag in the HTML document? a) <head> b) <title> c) <html> d) <document> Answer: c 63.The JDBC-ODBC bridge allows _______to be used as________. a) ODBC drivers, JDBC drivers b) Application, drivers c) ODBC drivers, JDBC drivers d) drivers, application Answer: c 64. Which is true about Java. a) Java doesn’t support the overloading. b) Java has replaced the destructor function of the C++ c) There are no any header files in the Java. d) All of the above. Answer: d
  • 20. www.javaassignmenthelp.net 65. ______are not machine instructions and the Java interpreter generate machine codes that is directly executed by machine running the Java program. a) Compiled Instructions b) Compiled code c) byte code d) Java mid code Answer: c 66. The command javac a) Converts the java program to binary code b) Converts the java program to bytecode c) Converts the java program to machine language Answer: b 67. Which is not primitive type of Java a) Float b) Byte c) Character d) Long double Answer: d
  • 21. www.javaassignmenthelp.net 68.Command to execute compiled java program is? a) java b) run c) javac d) javaw Answer: a 69.Java Servlet? i) is key component of server side java development ii) is a small pluggable extension to a server that enhances functionality iii) runs only in Windows Operating System iv) allows developers to customize any java enabled server a) i, ii & iii are ture b) i, iii & iv are true c) ii, iii & iv are true d) i, ii & iv are true() Answer: d 70.Inner classes are? a) anonymous classes b) nested classes c) sub classes
  • 22. www.javaassignmenthelp.net d) derived classes Answer: b 71.How many times does code segment execute int x=1, y=10, z=1; do{y--; x++; y-=2; y=z; z++} while (y>1 && z<10); a) 1 b) 10 c) 5 d) infinite Answer: a 72.State if the statement is true or false for EJB. 1. EJB exists in the middle-tier() 2. EJB specifies an execution environment 3. EJB supports transaction processing a) 1-true, 2. true, 3. true b) 1- true, 2. false, 3. true c) 1- false, 2- false, 3- false d) 1-true, 2-true, 3-false Answer: a
  • 23. www.javaassignmenthelp.net 73.Prepared statement object in the JDBC is being used to ins executing ____ queries. a) Executable b) simple c) high level d) parameterized Answer: d 74. In JDBC, ____ imports all Java classes that is concerned with the database connectivity. a)javax.sql.* b)java.mysql.* c)java.sql.* d) com.* Answer: c 75. MS-SQL is storing data in _____ file format. a) .DAT b) .MDB c) .MSSQL d) .OBJ Answer: a 76. Ingres is a? a) Socket b) Compiler c) Database
  • 24. www.javaassignmenthelp.net d) Web server Answer: c 77. In Java servlet method init( ) is called ______ times. a) 1 b) 2 c) 0 d) multiple Answer: a 78. State if it is true or false for Java Program. i) All class variables are instance variables ii) All protected methods are friendly methods a) i-false, ii-false b) i-false, ii-true c) i-true, ii-false d) i-true, ii-true Answer: b 79. State true or false for Java Program. i) Data members of an interface are by default final ii) An abstract class has implementations of all methods defined inside it. a) i-false, ii-false b) i-false, ii-true c) i-true, ii-false d) i-true, ii-true Answer: c 80. The _____ of remotely accessible object should implement? a) all methods, RemoteException
  • 25. www.javaassignmenthelp.net b) class, RemoteException c) class, RemoteInterface d) all methods, RemoteInterface Answer: c 81. The ____is the key to______. a) Serialization, persistence b) Persistence, inheritance c) Inheritance, object d) Persistence, serialization Answer: a 82. A method name myMethod( ) that needs 2 integer arguments is declared as? a) public void myMethod( ); b) public void myMethod(int a, int b); c) public void myMethod(int a, b); d) public int myMethod(a, b); Answer: b 83. JSP embeds in_____ in _____. a) Servlet, HTML b) HTML, Java c) HTML, Servlet d) Java, HTML Answer: d 84. The class at top of the exception class hierarchy is?
  • 26. www.javaassignmenthelp.net a) ArithmeticException b) Throwable c) Class d) Exception Answer: b 85. In the java program, the package declaration ____ import statements. a) must precede b) must succeed c) may precede or succeed d) none Answer: a 86. Class string belongs to the ____package. a) java.awt b) java.lang c) java.applet d) java.string Answer: d 87. ______package is being used by the compiler itself. So, it doesn’t need to be imported for use. a) java.math b) java.awt
  • 27. www.javaassignmenthelp.net c) java.applet d) java.lang Answer: d 88. State if it is true or false. i) Java beans slow down software development process. ii) Java Servlets does not have built in multithreading feature. a) i-false, ii-false b) i-false, ii-true c) i-true, ii-false d) i-true, ii-true Answer: a 89. State if it is true or false. i) init( ) of servlet is called after a client request comes in ii) Servlets are ultimately converted into JSP a) i-false, ii-false b) i-false, ii-true c) i-true, ii-false d) i-true, ii-true Answer: a
  • 28. www.javaassignmenthelp.net 90. What will be the result of compiling following code. public class MyClass{ public static void main(String args[]){ System.out.println("In first main()"); } public static void main(char args[]){ System.out.println('a'); } } a) Code will not compile and will give "Duplicate main() method declaration" error b) Code will compile correctly but will give a runtime exception c) Code will compile correctly and will print "In first main()" (without quotes) when it is run d) Code will compile correctly and will print "a" (without quotes) when it is run Answer: c 91. Match the following. a) Java 1) is a tool for debugging java program b) Javah 2) is a tool for creating C-like header files c) Javap 3) runs java bytecode d) jdb 4) prints java code representation a) a-3, b-2,c-1 b) a-3, b-2, c-4, d-1 c) a-1, b-2, c-3, d-4 d) a-2, b-1, c-3, d-4
  • 29. www.javaassignmenthelp.net Answer: b 92. State if it is true or false. i) init() is called after start() in applet ii) applets are used for networking iii) inheritance is a part of Java Foundation Classes iv) final does not prevent inheritance a) i-true, ii-true, iii-false, iv-true b) i-false, ii-false, iii-false, iv-false c) i-true, ii-true, iii-true, iv-true d) i-true, ii-false, iii-false, iv-false Answer: b 93. The ____and the ____classes are abstract classes supporting reading and writing of the byte streams. a) reader, writer b) inputstream, outputstream c) objectinputstream, objectoutputstream d) none Answer: b 94. What is error in the code? class Test { abstract void display( ); }
  • 30. www.javaassignmenthelp.net a) No error b) Method display( ) should be declared as static c) Test class should be declared as abstract d) Test class should be declared as public Answer: c 95. A package is a collection of? a) classes b) interfaces c) editing tools d) classes and interfaces Answer: d 96. Which methods belong to string class? a) length( ) b) compare To ( ) c) equals ( ) d) All of them Answer: d 97. What is the output of the code? byte x=64, y; y= (byte) (x<<2); System.out.println(y); a) 0 b) 1 c) 2 d) 64 Answer: a
  • 31. www.javaassignmenthelp.net 98. If m and the n are int type variables, what is result of the expression m%n when m=5 and n=2 ? a) 0 b) 1 c) 2 d) None of the above Answer: b 99. Which of the control expressions are valid when it comes to if statement? a) An integer expression b) A Boolean expression c) Either A or B d) Neither A nor B Answer: b 100. The concept of the multiple inheritance is being implemented in the Java by? a) extending two or more classes b) extending one class and implementing one or more interfaces c) implementing two or more interfaces d) both b and c Answer: b There you have java multiple choice interview questions that you may want to practice with so that you can study and learn of Java. If you need Java assignment help, feel free to contact us!