munotes®

BSc IT Sem IV 2018 19 Apr 2019 - CORE JAVA Question Paper with Solutions

MU B.Sc. (Information Technology) student group Free to join

Mumbai University Solved Question Papers munotes.in

2018 19

BSc IT · Sem IV

Apr 2019 - CORE JAVA Examination

Previous Year Question Paper with Solution

munotes.in Mumbai

munotes.in

First published on munotes.in on 12 November 2026.

Published by munotes.in, Mumbai.

Model answers written and edited by the munotes.in editorial desk.

Passages from this volume may be quoted, in print, online or by an AI system, with credit: name munotes.in and link to this volume's page. The volume may not be reproduced as a whole. Full terms at munotes.in/content-license.

munotes.in is an independent study resource for students of the University of Mumbai. It is not affiliated with the University of Mumbai, and is not endorsed by it.

The University does not publish an official answer key for this paper. The answers in this volume are model answers, written to show how a full-mark answer is built. They are a study aid, not an authority on what an examiner marked.

The question paper reproduced here is the paper as set by the University of Mumbai at the Apr 2019 - CORE JAVA examination.

munotes.in ii
munotes.in iii
munotes.in iv
munotes.in v

The Paper as Set

The questions in this volume are the questions asked at the Apr 2019 - CORE JAVA examination, reproduced as the University of Mumbai set them, in the order it set them. Nothing has been reworded, added or left out. Only the answers are ours. See the original question paper.

Duration 2½ hours  ·  Total marks 75  ·  30 questions answered

How to use this volume

Solve the paper first, under exam conditions and against the clock. Then read the answers here and mark your own. Reading a solution before attempting the question feels productive and teaches very little, because recognising an answer is not the same as being able to write one.

munotes.in vi

SECTION I

Q.1

Attempt any three of the following · 15 Marks

munotes.in 1

a.What is Java Virtual Machine (JVM)? Explain JVM components.[5]

Answer

For full marks, cover: what the JVM is and where it sits between the program and the machine, a labelled diagram, each component (class loader, runtime data areas, execution engine, native interface), the path of one method through them, and a conclusion.

What the JVM is

The Java Virtual Machine is the program that runs Java bytecode. The compiler javac turns a .java file into a .class file of bytecode. Bytecode is not the instruction set of any real processor. The JVM loads it, checks it and executes it on the machine it is running on.

Each operating system has its own JVM, but every JVM accepts the same bytecode. That is why one .class file runs on Windows, Linux and macOS alike.

Diagram

Marks.java --javac--> Marks.class (bytecode)

|

+---------------------------v---------------------------+

munotes.in 2

| 1. Class loader subsystem: load -> link -> initialise |

+-------------------------------------------------------+

| 2. Runtime data areas |

| method area | heap | Java stacks | PC registers |

| native method stacks |

+-------------------------------------------------------+

| 3. Execution engine: interpreter, JIT compiler, GC |

+-------------------------------------------------------+

| 4. Native method interface (JNI) -> native libraries |

+-------------------------------------------------------+

munotes.in 3

1. Class loader subsystem

It brings classes into the JVM when they are first needed, in three steps:

  1. Loading: reads the .class file. The bootstrap loader loads the core classes such as java.lang.String. The platform loader loads other Java SE classes, and the application loader loads the program's own classes.
  2. Linking: verifies that the bytecode is safe and well formed, prepares memory for static fields with default values, and resolves symbolic names into real references.
  3. Initialisation: runs the static initialisers and gives static fields their written values.

2. Runtime data areas

AreaHoldsShared?
Method areaEach class's structure, its methods' code and the constant poolShared by all threads
HeapEvery object and array made with newShared by all threads
munotes.in 4
AreaHoldsShared?
Java stackOne frame per method call: local variables and an operand stackOne per thread
PC registerThe address of the bytecode instruction being runOne per thread
Native method stackThe calls into native (non-Java) codeOne per thread

3. Execution engine

  1. The interpreter reads and runs bytecode one instruction at a time.
  2. The JIT (just-in-time) compiler turns frequently run methods into native machine code, so they run much faster afterwards.
  3. The garbage collector frees heap memory held by objects that no reference can reach.

4. Native method interface

The Java Native Interface (JNI) lets Java code call functions written in C or C++, kept in native method libraries.

munotes.in 5

One method through the JVM

public class Marks {

static int total(int theory, int practical) {

return theory + practical;

}

public static void main(String[] args) {

System.out.println("total(48, 27) = " + total(48, 27));

}

}

Output:

total(48, 27) = 75

The command javap -c Marks shows the bytecode that javac wrote for total():

static int total(int, int);

Code:

0: iload_0

1: iload_1

2: iadd

munotes.in 6

3: ireturn

The class loader loaded Marks. When total(48, 27) was called, a new frame was pushed on the thread's stack. It held theory = 48 and practical = 27 as local variables 0 and 1. The execution engine pushed both onto the operand stack (iload_0, iload_1), added them (iadd) and returned 75 (ireturn).

Conclusion. The JVM runs bytecode, so the same class file runs on any system that has a JVM. Its parts are the class loader, the runtime data areas, the execution engine with its interpreter, JIT compiler and garbage collector, and the native interface.

munotes.in 7

The rest of the answers

The first answer is free. The rest come with the B.Sc. (Information Technology) Semester 4 solved papers.

You have read the question paper and its first answer in full. Buy the solved papers once and you can read every answer of every solved paper in this semester.

Notes + practical solutions + solved papers: ₹798 Already bought it? Sign in

Or solved papers only: ₹499
Or notes + practical solutions: ₹499

The question paper itself stays free, and so does the syllabus.

Issue

Found an error in this volume? Report it and we will check it against the paper.

Done!