Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
44 views

Core Java 2020

This document contains a 60 question multiple choice exam on Core Java concepts. The questions cover topics like applets, I/O streams, networking, dates/times, and threads. Students are instructed to solve any 25 questions from questions 1-30 and any 25 questions from 31-60 within the one hour time limit.

Uploaded by

yamela rodriguez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Core Java 2020

This document contains a 60 question multiple choice exam on Core Java concepts. The questions cover topics like applets, I/O streams, networking, dates/times, and threads. Students are instructed to solve any 25 questions from questions 1-30 and any 25 questions from 31-60 within the one hour time limit.

Uploaded by

yamela rodriguez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Total No.

of Printed Pages:# 4 Examination October 2020


BSc (Information Technology) T.Y.(Sem- V)
4078 Core Java-II-IT507-T
Time: One Hour Max. Marks: 50
instruction
solve any 25 questions from Q.1 to Q.30
solve any 25 questions from Q.31 to Q.60

1 we try to write applets, we must make sure that Java is installed properly also ensure that either the java …………….. or
a java-enabled browser is available.
(A) viewer( ) (B) appletviewer( ) (C)appletrunner( ) (D)browserviewer( )
2 Which of these functions is called to display the output of an applet?
(A) display() (B) paint() (C)displayApplet() (D)PrintApplet()
3 Which of these class is used for operating on request from the client to the server?
(A) http (B) httpDecoder (C)httpConnection (D)httpd
4 Which of these method is used to start a server thread?
(A) run() (B) runThread() (C)start() (D)startThread()
5 Which of these method of DatagramPacket is used to find the length of byte array?
(A) getnumber() (B) length() (C)Length() (D)getLength()
6 Which of these method of DatagramPacket is used to find the port number?
(A) port() (B) getPort() (C)findPort() (D)receivePort()
7 Which of these methods is used to know host of an URL?
(A) host() (B) getHost() (C)GetHost() (D)gethost()
8 Which of these methods can be used to output a string in an applet?
(A) display() (B) print() (C)drawString() (D)transient()
9 Which of these is wrapper around everything associated with a reply from an http server?
(A) HTTP (B) HttpResponse (C)Httpserver (D)httpserver
10 Arrange the steps involved in developing and testing the applet in correct order.
i) creating an executable applet (.classfile)
ii) preparing <APPLET> tag
iii) creating HTML file
iv) building an applet code (.java file)
v) testing the applet code
(A) 1-i, 2-ii, 3-iii, 4-iv, 5-v (B) 1-ii, 2-iii, 3-iv, 4-v, 5-i (C)1-iv, 2-i, 3-ii, 4-iii, 5-v (D)1-iii, 2-iv, 3-v, 4-i, 5-ii
11 The domain name system is maintained by _______
(A) distributed database system (B) a single server (C)a single computer (D)none of the mentioned
12 The ………………… method called the first time an applet is loaded into the memory of a computer.
(A) init( ) (B) start( ) (C)stop( ) (D)destroy( )
13 Which of these functions is called to display the output of an applet?
(A) display() (B) paint() (C)displayApplet() (D)D. PrintApplet()
14 What does AWT stands for?
(A) All Window Tools (B) All Writing Tools (C)Abstract Window Toolkit (D)Abstract Writing Toolkit

015E78B71B27EBED96F8632E24229118
Examination October 2020
15 What is the Message is displayed in the applet made by the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("A Simple Applet", 20, 20);
}
}
(A) Simple Apple (B) A Simple Applet 20 20 (C)Compilation Error (D)Runtime Error
16 Which of these is used to perform all input & output operations in Java?
A. B.
C. D.
(A) streams (B) Variables (C)classes (D)Methods
17 Which of these classes are used by Byte streams for input and output operation?

(A) InputStream (B) InputOutputStream (C)Reader (D)All of the mentioned


18 Which of these class is used to read from byte array?
(A) InputStream (B) BufferedInputStream (C)ArrayInputStream (D)ByteArrayInputStream
19 Which of these exception is thrown in cases when the file specified for writing is not found?
(A) IOException (B) FileException (C)FileNotFoundException (D)FileInputException
20 Which of these values is returned by read() method is end of file (EOF) is encountered?
(A) 0 (B) 1 (C)-1 (D)Null
21 Which of these class contains the methods print() & println()?
(A) System (B) System.out (C)BUfferedOutputStream (D)PrintStream
22 Which of these classes are used by character streams output operations?
(A) InputStream (B) Writer (C)ReadStream (D)InputOutputStream
23 Which of these interface is not a member of java.io package?
(A) DataInput (B) ObjectInput (C)ObjectFilter (D)FileFilter
24 Which of these stream contains the classes which can work on character stream?
(A) InputStream (B) OutputStream (C)Character Stream (D)All of the mentioned
25 Which of these method of FileReader class is used to read characters from a file?
(A) read() (B) scanf() (C)get() (D)getInteger()
26 Which of these is a method to clear all the data present in output buffers?
(A) clear() (B) flush() (C)fflush() (D)close()
27 Which of these is a standard for communicating multimedia content over email?
(A) http (B) https (C)Mime (D)httpd
28 Which of these package contain all the Java’s built in exceptions?
(A) Java.io (B) Java. util (C)Java. Lang (D)Java.net
29 How many bits are in a single IP address?
(A) 8 (B) 16 (C)32 (D)64
30 Which of these is a protocol for breaking and sending packets to an address across a network?
(A) TCIP/IP (B) DNS (C)Socket (D)Proxy Server
31 Which of these is a full form of DNS?
(A) Data Network Service (B) Data Name Service (C)Domain Network Service (D)Domian Name Service
32 Which of these class is used to create servers that listen for either local or remote client programs?

015E78B71B27EBED96F8632E24229118
Examination October 2020
(A) httpServer (B) ServerSockets (C)MimeHeader (D)HttpResponse
33 How is Date stored in database?
(A) java.sql.Date (B) java.util.Date (C)java.sql.DateTime (D)java.util.DateTime
34 How to get UTC time?
(A) Time.getUTC(); (B) Date.getUTC(); (C)Instant.now(); (D)TimeZone.getUTC();
35 What will be the output of the following Java program?
class Output
{
public static void main(String args[])
{
int x = 3.14;
int y = (int) Math.abs(x);
System.out.print(y);
}}
(A) 0 (B) 3 (C)3.0 (D)3.1
36 Which one of the following contains date information?
(A) java.sql.TimeStamp (B) java.sql.Time (C)java.io.Time (D)java.io.TimeStamp
37 Which of these interface is implemented by Thread class?
(A) Runnable (B) Connections (C)Set (D)MapConnections
38 What does URL stands for?
(A) Uniform Resource Locator (B) Uniform Resource Latch (C)Universal Resource Locator (D)Universal Resource Latch
39 What is the output of this program?
import java.net.*;
class networking
{
public static void main(String[] args) throws UnknownHostException
{
InetAddress obj1 = InetAddress.getByName("cisco.com");
System.out.print(obj1.getHostName());
}
}

(A) cisco (B) cisco.com (C)www.cisco.com (D)none of the mentioned


40 Which class is used to create servers that listen for either local client or remote client programs?
(A) ServerSockets (B) httpServer (C)httpResponse (D)None of the above
41 TCP,FTP,Telnet,SMTP,POP etc. are examples of ?
(A) Socket (B) IP Address (C)Protocol (D)MAC Address
42 Which of these class is used to encapsulate IP address and DNS?
(A) DatagramPacket (B) URL (C)InetAddress (D)ContentHandler
43 What does the java.net.InetAddress class represent?
(A) Socket (B) IP Address (C)Protocol (D)MAC Address
44 Which of these package contains classes and interfaces for networking?
(A) java.io (B) java.util (C)java.net (D)java.network
45 The ……………………… method is called every time the applet receives focus as a result of scrolling in the active
window.
(A) init( ) (B) start( ) (C)stop( ) (D)destroy( )

015E78B71B27EBED96F8632E24229118
Examination October 2020
46 The ……………………… method is called every time the applet receives focus as a result of scrolling in the active
window.
(A) init( ) (B) start( ) (C)stop( ) (D)destroy( )
47 The Applet class is in ----package
(A) java.applet (B) java.io (C)java.util (D)java.awt
48 Find output of following:
public class Test
{
public static void main (String args[])
{
String str = NULL;
System.out.println(str);
}
}
(A) Null (B) Compile error (C)Code runs but no output (D)Runtime exception
49 What is the return type of the method getID() defined in AWT Event class
(A) Int (B) long (C)Object (D)float.
50 Which provides runtime environment for java byte code to be executed?
(A) JDK (B) JVM (C)JRE (D)JAVAC
51 Which of these methods is used to write() into a file?
(A) put() (B) putFile() (C)write() (D)writeFile()
52 Which of these values is returned by read() method is end of file (EOF) is encountered?
(A) 0 (B) 1 (C)-1 (D)Null
53 ---------------- is the protocol used to transmit hypertext over the Internet.
(A) HTTP (B) TCP (C)FTP (D)None of the above
54 When we invoke repaint() for a Component, the AWT invokes the method.
(A) draw() (B) show() (C)update() (D)paint()
55 Which of these class is necessary to implement datagrams?
(A) DatagramPacket (B) DatagramSocket (C)All of the mentioned (D)None of the mentioned
56 Which of these is an instance variable of class httpd?
(A) port (B) cache (C)log (D)All of the mentioned
57 Which of the following are legal operations?
(A) s3=s1 + s2; (B) s3=s1 - s2; (C)s3=s1 & s2 (D)s3=s1 && s2
58 How would you set the color of a graphics context called g to cyan?
A. B.
C. D.
(A) g.setColor(Color.cyan); (B) g.setCurrentColor(cyan); (C)g.setColor("Color.cyan"); (D)g.setColor("cyan’);
59 Which of the following are passed as an argument to the paint( ) method?
(A) Canvas object (B) Graphics object (C)Image object (D)paint object
60 Which of these operators is used to allocate memory for an object?
(A) malloc (B) alloc (C)new (D)give

015E78B71B27EBED96F8632E24229118

You might also like