
Competitive Programming Lab Quiz- 4B

Quiz
•
•
•
Hard
Chayapathi R
Used 7+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Solution{
public static void main(String[] args){
short x = 10;
x = x * 5;
System.out.print(x);
}
}
compilation Error
Generates Exception
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Solution{
public static void main(String[] args){
int[] x = {120, 200, 016};
for(int i = 0; i < x.length; i++){
System.out.print(x[i] + “ “);
}
}
}
none
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Identify the correct restriction on static methods.
I. They must access only static data
II. They can only call other static methods.
III. They cannot refer to this or super.
I and II
II and III
Only III
All of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class ArraysInJava
{
public static void main(String[] args)
{
int[] i = new int[-1];
i[1]=20;
System.out.println(i[1]);
}
}
This code will compile and run without any issues with the output 20
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Identify the corrected definition of a package.
A package is a collection of editing tools
A package is a collection of classes
A package is a collection of classes and interfaces
A package is a collection of interfaces
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of following Java code?
public class Main {
public static void main(String arg[]) {
int i;
for (i = 1; i <= 12; i += 2) {
if (i == 8) {
System.out.println(i);
break;
}
}
}
}
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
import java.util.Scanner;
class ThisKeyword {
private int a = 4;
private int b = 1;
void getSum(int a, int b) {
this.a = a;
this.b = b;
System.out.println(this.a + this.b);
}
}
public class Main {
public static void main(String args[]) {
ThisKeyword T = new ThisKeyword();
T.getSum(3, 5);
}
}
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Perkins CXL Quiz

Quiz
•
KG - University
20 questions
Technical Knowledge Kahoot

Quiz
•
KG - University
15 questions
numerical patterns input output

Quiz
•
5th Grade
20 questions
Know-It-All

Quiz
•
KG - University
20 questions
KNOW YOUR COUNTERPARTY (KYC) TRAINING

Quiz
•
KG - University
15 questions
English 2 REVIEW

Quiz
•
KG - University
15 questions
Personal Shopper

Quiz
•
KG - University
15 questions
starr review

Quiz
•
12th Grade
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
Discover more resources for
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade