public class Solution{
public static void main(String[] args){
short x = 10;
x = x * 5;
System.out.print(x);
}
}
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);
}
}
15 questions
adjectives
Quiz
•
KG - University
16 questions
A+ Core 1 Exam 7 - Missed Questions
Quiz
•
KG - University
20 questions
SafeSplash 2020 March Meeting
Quiz
•
KG - University
20 questions
Know-It-All
Quiz
•
KG - University
17 questions
OC training Test
Quiz
•
KG - University
15 questions
Recruitment: 1st Year Tier Avibhuj Squad
Quiz
•
KG - University
24 questions
Agile Quiz 14.12.2023
Quiz
•
KG - University
20 questions
Tech Genius II
Quiz
•
KG - University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade