
JAVA
Authored by Nevedha K
Computers
Professional Development
Used 9+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Main{
public static void main(String[] args) {
int Integer = 24;
char String = 'I';
System.out.print(Integer);
System.out.print(String);
}}
Compile time error
24I
Run time Error
24
I
Exception
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the correct option which will print as 50:
public class Main{
public static void main(String[] args) {
short x = 10;
x = (short)x * 5;
System.out.print(x);
}}
public class Main{
public static void main(String[] args) {
short x = 10;
x = x * 5;
System.out.print(x);
}}
public class Main{
public static void main(String[] args) {
short x = 10;
x = (short)(x * 5);
System.out.print(x);
}}
public class Main{
public static void main(String[] args) {
int x = 10;
short x1 = x * 5;
System.out.print(x1);
}}
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Main{
public static void main(String[] args) {
byte x = 126;
x++;
x++;
System.out.print(x);
}}
-128
127
126
128
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Main{
public static void main(String[] args) {
byte x = 127;
x++;
x++;
System.out.print(x);
}}
-127
128
129
127
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Main{
public static void main(String[] args) {
String str = "abcde";
System.out.println(str.substring(1, 3));
}}
abc
bc
bcd
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Main{
public static void main(String[] args) {
String str = "Hello world";
System.out.println(str.indexOf('t'));
}}
-1
false
Error
0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Main{
public static void main(String[] args) {
String str1 = "vcet";
String str2 = "Erode";
System.out.println(str2.concat(str1));
}}
Compile Time Error
vcet Erode
Erode vcet
Erodevcet
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?