0% found this document useful (0 votes)
57 views

B.Tech CSC - IV Sem Quiz I Time: 50 Min. Marks:10 (Weightage:2.5) Name: Reg No

This document contains a quiz with 5 questions for a 4th semester B.Tech CSC course. The quiz has multiple coding questions to test knowledge of Java fundamentals like data types, output of code snippets, and the roles of the JVM and JRE. It instructs students to answer directly on the provided sheet within 50 minutes and is worth 10 marks total with a weightage of 2.5.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

B.Tech CSC - IV Sem Quiz I Time: 50 Min. Marks:10 (Weightage:2.5) Name: Reg No

This document contains a quiz with 5 questions for a 4th semester B.Tech CSC course. The quiz has multiple coding questions to test knowledge of Java fundamentals like data types, output of code snippets, and the roles of the JVM and JRE. It instructs students to answer directly on the provided sheet within 50 minutes and is worth 10 marks total with a weightage of 2.5.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

B.

Tech CSC – IV Sem


Quiz I
Time: 50 min. Marks:10 (Weightage:2.5)
Name: Reg No:

Instructions:
- All questions are compulsory and carry equal marks
- Attempt the answer on the given sheet
Q1. What will be the output of the following code, if there is an error, specify the reason for the error:

(a) class Hello { int k; } (b) class Main


class Test { { public static void main(String[] args) {
public static void main(String args[]) { double i = 100.01;
Hello ob; long j = d;
System.out.println(ob.k); }} System.out.println("j= " + j);
}}

Q2. Why is java known as Platform Independent language?

Q3. What will be the output of the following code, if there is an error, specify the reason for the error:

(a) class Main { (b) class Test{


public static void main(String args[]) { public static void main(String[] args) {
byte a = 16; int i = 100;
System.out.println(a); long j = i;
a++; float k = j;
System.out.println(a)`; System.out.println("i= " + i+“j="+ j+ "k="+ k);
a++; } }
System.out.println(a);
a++;
System.out.println(a); }

(c) class Main { (d) class Main {


public static void main(String args[]) { public static void main(String args[])
byte b =50; { int i;
b = b*2; }} System.out.println(i+2); } }
(e) class Hello{ (f) class Test {
public static void main(String args[]) { public void main( String[] args ) {
double a = 376.9; System.out.print ( "bye" + “\nhi” );
int b = 456; System.out.println ( "helllo" ); } }
byte c = (byte) a;
byte d = (byte) b;
System.out.println(c + " " + d);
} }

Q4. Define various data types in terms of its purpose, size, range and default value?

Q5. Define the role of JVM and JRE?

You might also like