JAVA MID - EXAM PAPER - Wordgoogle Forms

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 34

11/2/2020 JAVA MID- EXAM PAPER

JAVA MID- EXAM PAPER


Java Multiple Choice Questions
* Required

1. Email address *

2. STUDENT NAME *

3. ROLL NO *

4. year *

Mark only one oval.

III

5. SECTION *

Mark only one oval.

III

IV

60 QUESTIONS ARE EVALUATED FOR 20 M

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 1/34
11/2/2020 JAVA MID- EXAM PAPER

6. 1) Which of the following option leads to the portability and security of Java?
a. Bytecode is executed by JVM
b. The applet makes the Java code secure and portable

c. Use of exception handling

d. Dynamic binding between objects

7. 2) Which of the following is not a Java features?

a. Dynamic

b. Architecture Neutral

c. Use of pointers
d. Object-oriented

8. 3)What would be the output of the following fraction of code ? int Integer = 34 ;
char String = 'S' ; System.out.print( Integer ) ; System.out.print( String ) ;

a)int Integer = 34 ;

b)34 s

c)System.out.print( Integer ) ;
d)System.out.print( String ) ;

9. 4)The following fraction of codedouble STATIC = 2.5 ;System.out.println( STATIC );

A.Prints 2.5

B. Rraises an error as STATIC is used as a variable which is a keyword

C. Raises an exception

D. None of these

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 2/34
11/2/2020 JAVA MID- EXAM PAPER

10. 5)Determine output: public class Test { static void test(float x)


{ System.out.print("float"); } static void test(double x)
{ System.out.print("double"); } public static void main(String[] args){ test(99.9); } }

A.float

B. double

C. Compilation Error

D. Exception is thrown at runtime

11. 6)Which of the following automatic type conversion will be possible?

Mark only one oval.

A.short to int

B. byte to int

C. int to long

D. long to int

12. 7)Automatic type conversion in Java takes place when?

A.Two type are compatible and size of destination type is shorter than source type.

B. Two type are compatible and size of destination type is equal of source type.

C. Two type are compatible and size of destination type is larger than source type.
D. All of the above

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 3/34
11/2/2020 JAVA MID- EXAM PAPER

13. 8)Size of float and double in Java is?


A.32 and 64

B. 64 and 64

C. 32 and 32

D. 64 and 32

14. 9)The smallest integer type is ......... and its size is .........

bits..

A.short, 8

B. byte, 8

C. short, 16

D. short, 16

15. 10)Size of int in Java

is?

16 bit

B. 32 bit

C. 64 bit

D. Depends on execution environment

16. 11)In Java byte, short, int and long all of these

are?

A.signed

B. unsigned

C. Both of the above

D. None of these

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 4/34
11/2/2020 JAVA MID- EXAM PAPER

17. 12)How many primitive data types are there in Java?

A.6

B. 7

C. 8

D. 9

18. 13)Java is a ……….language?

weakly typed

B. strongly typed

C. moderate typed

D. None of these

19. 14)Given a method in a protected class, what access modifier do you use to
restrict access to that method to only the other members of the same class?

A.Final

B.Static

C.Private

D.Protected or Volatile

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 5/34
11/2/2020 JAVA MID- EXAM PAPER

20. 15)Which of the following class level (nonlocal) variable declarations will not
compile?

A.protected int a;

B.transient int b = 3;

C.private synchronized int e;

D.volatile int d;

21. 16)Which two of the following are legal declarations for nonnested classes and
interfaces? 1. final abstract class Test {} 2. public static interface Test {} 3. final
public class Test {} 4. protected abstract class Test {} 5. protected interface Test
{} abstract public class Test {}?

A.1 and 4

B.2 and 5

C.3 and 6

D.4 and 6

22. 17)Which one creates an instance of an array?

int[ ] ia = new int[15];

float fa = new float[20];

char[ ] ca = "Some String";


int ia[ ] [ ] = { 4, 5, 6 }, { 1,2,3 };

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 6/34
11/2/2020 JAVA MID- EXAM PAPER

23. 18)class A { protected int method1(int a, int b) { return 0; } }Which is valid in a


class that extends class A?

A.public int method1(int a, int b) {return 0; }

B.private int method1(int a, int b) { return 0; }

C.public short method1(int a, int b) { return 0; }

D.static protected int method1(int a, int b) { return 0; }

103. 19) how to identify interface program?

A)By using extends Keyword

B)By using implements and interface Keyword

C)by using implements keyword

D)both B and C
24.

25. 20)What is the return type of the hashCode() method in the Object class?

A.a. Object

B.int

C long

D. void

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 7/34
11/2/2020 JAVA MID- EXAM PAPER

26. 21)) Which of the following creates a List of 3 visible items and multiple
selections abled?

A)new List(false, 3)

B)new List(3, true)

C)new List(true, 3)

D)new List(3, false)

27. 22)Which method of the Class.class is used to determine the name of a class
represented by the class object as a String?

A)getClass()

B) intern()

C)getName()

D)toString()

28. 23)In which process, a local variable has the same name as one of the instance
variables?

A)Serialization

B)Variable Shadowing

C)Abstraction

D)Multi-threading

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 8/34
11/2/2020 JAVA MID- EXAM PAPER

29. 24)Which of the following is true about the anonymous inner class?.

A)It has only methods

B)Objects can't be created

C)It has a fixed class name

D)It has no class name

30. 25)Which package contains the Random

class?.

A)java.util package

B) java.lang package

C) java.awt package

D)java.io package

31. 26)What do you mean by nameless objects?

32. A)An object created by using the new keyword.

B)An object of a superclass created in the subclass

C).An object without having any name but having a reference.

D)An object that has no reference

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 9/34
11/2/2020 JAVA MID- EXAM PAPER

32. 27)An interface with no fields or methods is known as a ______.

A)Runnable Interface

B)Marker Interface

C)Abstract Interface

D)CharSequence Interface

104. 28) What is meant by abstract?

A)hiding the process

B)combinding the process

C)creating objects

D)many forms

34. 29)Which option is false about the final keyword?

l.

A)A final method cannot be overridden in its subclasses

B)A final class cannot be extended

C)A final class cannot extend other classes.

D)A final method can be inherited.

35. 30)Which of these classes are the direct subclasses of the Throwable class?

A)RuntimeException and Error class

B)Exception and VirtualMachineError class

C)Error and Exception class

D)IOException and VirtualMachineError class

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 10/34
11/2/2020 JAVA MID- EXAM PAPER

36. 31)What do you mean by chained exceptions in Java?

A)Exceptions occurred by the VirtualMachineError

B)An exception caused by other exceptions

C)Exceptions occur in chains with discarding the debugging information

D)None of the above

37. 32)In which memory a String is stored, when we create a string using new
operator?

A)Stack

B) String memory

C)Heap memory

D)Random storage space

38. 33)What is the use of the intern() method?

A)It returns the existing string from memory

B)It creates a new string in the database

C)It modifies the existing string in the database

D)None of the above

39. 34)Which of the following is a marker interface?.

A)Runnable interface

B)b. Remote interface

C)Readable interface

D)Result interface

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 11/34
11/2/2020 JAVA MID- EXAM PAPER

40. 35) Which of the following is a reserved keyword in Java?

a. object

b. strictfp

c. main

pointer

41. 36)Which keyword is used for accessing the features of a package?.

A)package

B)import

C)extends

D)export

42. 37)) In java, jvm stands

for_____. Mark only one oval.

A)java virtual machine

B)java verision machine

C)java volatile micro

D)java volatile macro

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 12/34
11/2/2020 JAVA MID- EXAM PAPER

43. 38) In java, jar stands

for_____..

A)Java Archive Runner

B)Java Application Resource

C) Java Application Runner

D)None of the above

44. 39) is the use of \w in regex?

Mark only one oval.

A)Used for a whitespace character

B)Used What for a non-whitespace character

C)Used for a word character


D)Used for a non-word character

45. 40) is the use of \w in regex?

Mark only one oval.

a. Used for a whitespace character.

b. Used What for a non-whitespace character

c. Used for a word character

d. Used for a non-word character

46. 41)Which of the given methods are of Object class?

Mark only one oval.

a. notify(), wait( long msecs ), and synchronized()

b. wait( long msecs ), interrupt(), and notifyAll()

c. notify(), notifyAll(), and wait()

d. sleep( long msecs ), wait(), and notify()

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 13/34
11/2/2020 JAVA MID- EXAM PAPER

47. 42) What is meant by the classes and objects that dependents on each other?

Mark only one oval.

a. Tight Coupling

b. Cohesion

c. Loose Coupling
d. None of the above

48. 43)How many threads can be executed at


a time? a. Only one thread

b. Multiple threads

c. Only main (main() method) thread


d. Two threads

49. 44)If three threads trying to share a single object at the same time, which
condition will arise in this scenario?
.

a. Time-Lapse

b. Critical situation

c. Race condition
d. Recursion

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 14/34
11/2/2020 JAVA MID- EXAM PAPER

50. 45)Which of the following modifiers can be used for a variable so that it can be
accessed by any thread or a part of a program?

a. global

b. transient

c. volatile
d. default

51. 46)Which one of these lists contains only Java programming language
keywords?

A.class, if, void, long, Int, continue

B.goto, instanceof, native, finally, default, throws

C.try, virtual, throw, final, volatile, transient

D.strictfp, constant, super, implements, do/byte, break, assert, switch, include

52. 47)Which will legally declare, construct, and initialize an


array? int [] myList = {"1", "2", "3"};

int [] myList = (5, 8, 2);

int myList [] [] = {4,9,7,0};


int myList [] = {4, 3, 7};

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 15/34
11/2/2020 JAVA MID- EXAM PAPER

53. 48)Which is a valid keyword in

java?.

A.interface

B.string

C.Float

D.unsigned

54. 49)Which three are legal array declarations? 1. int [] myScores []; 2. char []
myChars; 3. int [6] myScores; 4. Dog myDogs [];5. Dog myDogs [7];

A.1, 2, 4

B.2, 4, 5

C.2, 3, 4

D.All are correct.

55. 50)Which one of the following will declare an array and initialize it
with five numbers?.

A.Array a = new Array(5);

B.int [] a = {23,22,21,20,19};

C.int a [] = new int[5];

D.int [5] array;

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 16/34
11/2/2020 JAVA MID- EXAM PAPER

56. 51)Which three are valid declarations of a char?1. char c1 = 064770;2. char c2
= 'face';3. char c3 = 0xbeef;4. char c4 = \u0022;5. char c5 = '\iface';6. char c6 =
'\uface';

1,2,4

1,3,6

3, 5
5 only

57. 52)Which is the valid declarations within an interface definition?.

A)public double methoda();

B)public final double methoda();

C)static void methoda(double d1);

D)protected void methoda(double d1);

58. 53)Which one is a valid declaration of a

boolean?.

A.boolean b1 = 0;

B.boolean b2 = 'false';

C.boolean b3 = false;

D.boolean b4 = Boolean.false();/boolean b5 = no;

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 17/34
11/2/2020 JAVA MID- EXAM PAPER

59. 53)Which three are valid declarations of a float?1. float f1 = -343;2. float f2 =
3.14;3. float f3 = 0x12345;4. float f4 = 42e7;5. float f5 = 2001.0D;6. float f6 =
2.81F;

A.1, 2, 4

B.2, 3, 5

C.1, 3, 6

D.2, 4, 6

60. 54)Which is a valid declarations of a String?


A.String s1 = null;

B.String s2 = 'null';

C.String s3 = (String) 'abc';

D.String s4 = (String) '\ufeed';

61. 55)What is the numerical range of a char?

Mark only one oval.

A)-128 to 127

B)-(215) to (215) - 1

C)0 to 32767

D)0 to 65535

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 18/34
11/2/2020 JAVA MID- EXAM PAPER

62. 56)What will be the output of the program? class Test { public static void
main(String [] args) { int x=20; String sup = (x < 15) ? "small" : (x < 22)?
"tiny" : "huge"; System.out.println(sup); }}

small

tiny

huge

Compilation fails

63. 57)Which is true about a method-local inner


class? A.It must be marked final.

B.It can be marked abstract.

C.It can be marked public.

D.It can be marked static.

64. 58)You want subclasses in any package to have access to members of a


superclass. Which is the most restrictive access that accomplishes this
objective?

Mark only one oval.

A.public

B.private

C.protected

D.transient

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 19/34
11/2/2020 JAVA MID- EXAM PAPER

65. 59)What is the most restrictive access modifier that will allow members of one
class to have access to members of another class in the same package?

Mark only one oval.

A.public

B.abstract

C.protected

D.synchronized/default access

Option 5

66. 60)Which cause a compiler error?

Mark only one oval.

A.int[ ] scores = {3, 5, 7};

B.int [ ][ ] scores = {2,7,6}, {9,3,45};

C.String cats[ ] = {"Fluffy", "Spot", "Zeus"};

D.boolean results[ ] = new boolean [] {true, false, true};

67. 61)You want a class to have access to members of another class in the same
package. Which is the most restrictive access that accomplishes this objective?

A.public

B.private

C.protected

D.default access

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 20/34
11/2/2020 JAVA MID- EXAM PAPER

68. 62)Which is valid in a class that extends class A

A.public int method1(int a, int b) {return 0; }

B.private int method1(int a, int b) { return 0; }

C.public short method1(int a, int b) { return 0; }

D.static protected int method1(int a, int b) { return 0; }

69. 63)Which two of the following are legal declarations for nonnested classes and
interfaces?1. final abstract class Test {}2. public static interface Test {}3. final
public class Test {}4. protected abstract class Test {}5. protected interface Test
{}6. abstract public class Test {}

A.1 and 4

B.2 and 5

C.3 and 6

D.4 and 6

70. 64)You want subclasses in any package to have access to members of a


superclass. Which is the most restrictive access that accomplishes this
objective?

A.public

B.private

C.protected

D.transient

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 21/34
11/2/2020 JAVA MID- EXAM PAPER

71. 65)Which three form part of correct array declarations? 1. public int a [ ]2. static
int [ ] a3. public [ ] int a4. private int a [3]5. private int [3] a [ ]6. public final int [ ] a

A.1, 3, 4

B.2, 4, 5

C.1, 2, 6

D.2, 5, 6

72. 66)What is the most restrictive access modifier that will allow members of one
class to have access to members of another class in the same package?

public

abstract

protected

synchronized/default access

73. 67)You want a class to have access to members of another class in the same
package. Which is the most restrictive access that accomplishes this objective?

public

private

protected
default access

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 22/34
11/2/2020 JAVA MID- EXAM PAPER

74. 68)Which two of the following are legal declarations for nonnested classes and
interfaces?1. final abstract class Test {}2. public static interface Test {}3. final
public class Test {}4. protected abstract class Test {}5. protected interface Test
{}6. abstract public class Test {}

A.1 and 4

B.2 and 5

C.3 and 6

D.4 and 6

75. 69)Which of the following class level (nonlocal) variable declarations will not
compile?

A.protected int a;

B.transient int b = 3;

C.private synchronized int e;

D.volatile int d;

76. 70)Which two cause a compiler error?1. float[ ] f = new float(3);2. float f2[ ] =
new float[ ];3. float[ ]f1 = new float[3];4. float f3[ ] = new float[3];5. float f5[ ] =
{1.0f, 2.0f, 2.0f};

A.2, 4

B.3, 5

C.4, 5

D.1, 2

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 23/34
11/2/2020 JAVA MID- EXAM PAPER

77. 71)Given a method in a protected class, what access modifier do you use to
restrict access to that method to only the other members of the same class?

final

static

private

protected or volatile

78. 72)Which is a valid declaration within an interface?

Mark only one oval.

A.public static short stop = 23;

B.protected short stop = 23;

C.transient short stop = 23;

D.final void madness(short stop);

79. 73)switch(x) { default: System.out.println("Hello"); }Which two are acceptable


types for x?1. byte2. long3. char4. float5. Short6. Long

Mark only one oval.

A.1 and 3

B.2 and 4

C.3 and 5

D.4 and 6

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 24/34
11/2/2020 JAVA MID- EXAM PAPER

80. 74)A process that involves recognizing and focusing on the important
characteristics of a situation or object is known as

Mark only one oval.

(a) Encapsulation

(b) Polymorphism

(c) Abstraction

(d) Inheritance

81. 75)Which statement is true regarding an object?

(a) An object is what classes instantiated are from

(b) An object is an instance of a class

(c) An object is a variable

(d) An object is a reference to an attribute

82. 76) In object-oriented programming, composition relates to

The use of consistent coding conventions

(b) The organization of components interacting to achieve a coherent, common


behavior

(c) The use of inheritance to achieve polymorphic behavior

(d) The organization of components interacting not to achieve a coherent common


behavior

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 25/34
11/2/2020 JAVA MID- EXAM PAPER

83. 77) In object-oriented programming, new classes can be defined by extending


existing classes. This is an example of:

Mark only one oval.

(a) Encapsulation

(b) Interface

(c) Composition

(d) Inheritance

84. 78)Which of the following does not belong: If a class inherits from some other
class, it should

Mark only one oval.

(a) Make use of the parent class’s capabilities

(b) Over-ride or add the minimum to accomplish the derived class’ purpose

(c) Over-ride all the methods of its parent class

(d) Make sure the result “IS-A-KIND-OF” its base class

85. 79)Object-oriented inheritance models the

Mark only one oval.

(a) “is a kind of” relationship

(b) “has a” relationship

(c) “want to be” relationship

(d) inheritance does not describe any kind of relationship between classes

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 26/34
11/2/2020 JAVA MID- EXAM PAPER

86. 80)The wrapping up of data and functions into a single unit is called

(a) Encapsulation

(b) Abstraction

(c) Data Hiding

(d) Polymorphism

87. 81) Polymorphism

(a) Refers to the ability of two or more objects belonging to different classes to
respond to exactly the same message in different class-specific ways

(b) Simplifies code maintenance

(c) Not simplifies code maintenance

(d) Refers to the ability of two or more objects belonging to different classes to
respond to exactly the same message in different class-specific ways and simplifies
code maintenance.

88. 82) In object-oriented programming, new classes can be defined by extending


existing classes. This is an example of:

Mark only one oval.

(a) Encapsulation

(b) Interface

(c) Composition

(d) Inheritance n 4

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 27/34
11/2/2020 JAVA MID- EXAM PAPER

89. 83)Given a class named student, which of the following is a valid constructor
declaration for the class?

Mark only one oval.

(a) Student (student s) { }

(b) Student student ( ) { }

(c) Private final student ( ) { }

(d) Void student ( ) { }

90. 84)What is the error in the following class definitions?Abstract class xy{abstract
sum (int x, int y) { }}

(a) Class header is not defined properly.

(b) Constructor is not defined.

(c) Method is not defined properly

(d) Method is defined properly

91. 85) Which of these field declarations are legal within the body of an interface?
(a) Private final static int answer = 42 (b) public static int answer=42(c) final
static answer =42 (d) int answer

Mark only one oval.

(a) Private final static int answer = 42

(b) public static int answer=42

(c) final static answer =42

(d) int answer

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 28/34
11/2/2020 JAVA MID- EXAM PAPER

92. 86)A package is a collection of

Mark only one oval.

(a) Classes

(b) Interfaces

(c) Editing tools

(d) Classes and interfaces

93. 87) A method within a class is only accessible by classes that are defined within
the same package as the class of the method. Which one of the following is used
to enforce such restriction?

Mark only one oval.

(a) Declare the method with the keyword public

(b) Declare the method with the keyword private

(c) Declare the method with the keyword protected

(d) Do not declare the method with any accessibility modifiers

94. 88)Basic Java language functions are stored in which of the following java
package?

Mark only one oval.

(a) java.lang

(b) java.io

(c) java.net

(d) java.util

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 29/34
11/2/2020 JAVA MID- EXAM PAPER

95. 89) Given the code String s1 = ” yes” ;String s2 = ” yes ” ;String s3 = new String
( s1);Which of the following would equate to true?

Mark only one oval.

(a) s1 == s2 .

(b) s1 = s2

(c) s3 == s1

(d) s3=s1

96. 90) Which of the following events will cause a thread to die?

(a) The method sleep( ) is called

(b) The method wait( ) is called

(c) Execution of the start( ) method ends

(d) Execution of the run( ) method ends

97. 91) Which one of these is a valid method declaration?

(a)void method1

(b)void method2()

(c)void method3(void)

(d)method4()

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 30/34
11/2/2020 JAVA MID- EXAM PAPER

98. 92) Given a class named Book, which one of these is a valid constructor
declaration for the class?

a)Book(Book b) { }

b)Book Book() { }

c)private final Book() { }


d)void Book() { }

99. 93)Which statement is true about accessibility of members?

a)Private members are always accessible from within the same package

b)Private members can only be accessed by code from within the class of the
member

c)A member with default accessibility can be accessed by any subclass of the
class in which it is defined

d)Private members cannot be accessed at all

100. 94) Which of the following is true about the use of modifiers?

a)If no accessibility modifier (public, protected, and private) is specified for a


member declaration, the member is only accessible for classes in the package of its
class and subclasses of its class anywhere

b)You cannot specify accessibility of local variables. They are only accessible
within the block in which they are declared

c)Subclasses of a class must reside in the same package as the class they
extend

d)Local variables can be declared static

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 31/34
11/2/2020 JAVA MID- EXAM PAPER

101. 95)Who invented java?

Mark only one oval.

A)james Gosley

B)Denni's ritche

C)Charles babage

D)babaje

102. 96)What is meant By package?

A)group of classes,sub classes,interfaces

B)group of objects

C)group of classes

D)classes and objects

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 32/34
11/2/2020 JAVA MID- EXAM PAPER

105. 97)What is meant by Type casting?

A)converting data one form to another datatype

B)converting one object to another object

C)converting one class to another class

D)All

106. 98)class is

Mark only one oval.

A)group of objects

B)group of sub classes

C)datatypes

D)packages

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 33/34
11/2/2020 JAVA MID- EXAM PAPER

107. 99)Encapsulation

Mark only one oval.

A)combinding the Data

B)Hiding the Data

C)storing the Data

D)Forming the Data

108. 100)polymorphism means

Mark only one oval.

A)many forms

B)few forms

C)low forms

D)High Forms

This content is neither created nor endorsed by Google.

Forms

https://docs.google.com/forms/d/1CJiK0mxlPjBxwPHdc8EyWRI9Y31BkzAdrF_aag4zECs/edit 34/34

You might also like