Infosys Certified Java SE8 Developer
Practice with real exam-pattern questions for Infosys Certified Java SE8 Developer. Each question includes a detailed explanation to help you understand the concept, not just memorise the answer. Try 10 questions free — no login required.
Full question bank for this exam + 1,357+ others. Cancel anytime.
Join Premium10 Infosys Certified Java SE8 Developer practice questions with answers
Real Lex exam-pattern multiple-choice questions for the Infosys Certified Java SE8 Developer certification. Each question includes the correct answer. The full question bank is available to Premium members.
- Question 1
Which of the following options is/are TRUE bout Java constructors? [Select exactly 2 correct options]
- ✓
Constructors are used for creating Java objects
Correct - B
Constructors are used for initializing instance variables only
- C
Constructors are used for performing arithmetic operations
- D
Constructors are used for calling the super-class constructors only
- E
Constructors are used for initializing static variables
- ✓
- Question 2
What will be the output of the below code?
public class Tester {
public static void main(String[] args) {
String name = "John";
System.out.print(name.matches("[A-z].*{0,}"));
System.out.print(name.matches("[\\w].*{1,4}"));
}
}- ✓
false-false
Correct - B
false-true
- C
true-false
- D
true-true
- ✓
- Question 3
Observe the below code:
public class Q5Tester {
public static void main(String[] args) {
int a=3;
int b=9;
//Line 1
{
System.out.print(""+a+""+b);
System.out.print(""+a+""+b);
}
}
}Which of the following for loop is the correct one to be added at Line 1 to get the output as 310310? [Select exactly 3 correct options]
- ✓
for(a=4-1, b=10-1;(a<4)&&(b++ <10);a+=1)
Correct - B
for(a=3, b=9;(a<4)&&(b++ <10);a++)
- C
for(;(a<5)&&(b+=2 <10);a++)
- D
for(;(a<4)&&(b++ <10);a++)
- E
for(;(a<4)||(b++ <10);a++)
- ✓
- Question 4
What will be the output of the below code?
public class Tester {
public static void main(String[] args) {
for(Directions dir : Directions.values())
{
System.out.print(dir.toString());
System.out.print(dir.ordinal());
System.out.println();
}
}
enum Directions{
EAST(1), WEST(2), NORTH(3), SOUTH(4);
int value;
private Directions(int value) {
this.value = value;
}
}
}- ✓
EAST0
Correct
WEST1
NORTH2
SOUTH3 - B
EAST1
WEST2
NORTH3
SOUTH4 - C
East0
West1
North2
South3 - D
East1
West2
North3
South4
- ✓
- Question 5
Observe the below code snippet:(Assume that class declaration is done properly and it is written in the main method)
int intValue = 100;
float floatValue = 100.0F;
double doubleValue = 100.0D;
char charValue = 100;
byte byteValue = 100;
dataType result = (intValue * byteValue + (doubleValue/floatValue)) * charValue;Which of the following data types can be used in place of 'dataType' for the identifier 'result' for successful compilation of the program?
- ✓
int
Correct - B
float
- C
double
- D
char
- E
byte
- ✓
- Question 6
Which of the following components in Java Virtual Machine(JVM) is mainly responsible for executing the Java byte codes?
- ✓
Class Loader
Correct - B
Java Runtime Environment(JRE)
- C
Java Development Kit(JDK)
- D
JIT Compiler
- E
Java Compiler
- ✓
- Question 7
There are 5 method declarations have been given below.
Identify the combination of methods that can be defined in a single Java class without any compilation errors.
Select the most suitable option.i.void doTask(Integer x, int y){}
ii.void doTask(int x, Integer y){}
iii.void doTask(int x, int y){}
iv.void doTask(Integer x, Integer y){}
v.void doTask(Integer x, Integer y, int z){}- ✓
i, ii, iii, iv and v together
Correct - B
Only i and iii together
- C
Only ii and iv together
- D
Only i and v together
- E
Only i, iii, and v together
- ✓
- Question 8
What will be the output the below code when executed?
public class Tester {
public static void main(String[] args) {
int intValue = 100;
String strValue = "John";
float floatValue = 20.0f;if (intValue > 100 || strValue == "John" && floatValue < 20.01f) {
System.out.println("if");
} else if (intValue >= 100 || strValue.endsWith("John") || floatValue < 21.01f) {
System.out.println("elseif-1");
} else if (intValue == 100 || strValue.startsWith("John") || floatValue > 19.01f) {
System.out.println("elseif-2");
} else {
System.out.println("else");
}
}
}- ✓
if
Correct - B
elseif-1
- C
elseif-2
- D
else
- ✓
- Question 9
Observe the below code developer by John. He's getting a Warning Line 4 as "The value of the local variable intValue is not used". Help John to supress that warning.
//Line 1
public class Tester {
//Line 2
public static void main(String[] args) {
//Line 3
int intValue = 0; //Line 4: Warning: The value of the local variable intValue is not used
String strValue = "John";
System.out.println(strValue);
}
}Which of the following approaches John can follow to suppress the Warning occurring at Line 4?
- ✓
@SuppressWarnings("unused") can be used at any one of the places - Either at Line 1 OR at Line 2 OR at Line 3
Correct - B
@SuppressWarnings("unused") can only be used at Line 1
- C
@SuppressWarnings("unused") can only be used at Line 2
- D
@SuppressWarnings("unused") can only be used at Line 3
- ✓
- Question 10
What will be the output of the below code?
import java.util.Arrays;
public class Tester {
public static void main(String[] args) {
String arr[] = {"Z", "H", "B", "A", "X"};
Arrays.sort(arr);
Arrays.copyOf(arr, 6);
Arrays.fill(arr, 4, 5, "X");
Arrays.toString(arr);
for (String str : arr) {
System.out.print(str);
}
}
}
- ✓
ABHXZ
Correct - B
ABHXX
- C
ZHBAX
- D
XHBAX
- ✓
More in Java
Infosys Certified Expert Programmer-Level 1
Infosys Certified Go Programmer
Infosys Certified Go REST Developer
Pay once. Clear every cert this year.
One subscription, full Telegram channel access, every PDF posted during your membership.
- Full access to all 1,357+ certifications
- Monthly updated question banks
- Telegram private channel access
- Cancel anytime
- Everything in Monthly
- Save ₹2,100 vs monthly billing
- Priority answer key requests
- Best for increasing DQ score fast
- Everything in Quarterly
- Lifetime channel access — no renewals
- All future certifications included
- Priority response from admin team
Common questions, straight answers.
A monthly-updated Telegram channel where we post real exam-pattern question banks and detailed answer keys for 1,357+ Infosys Lex certifications. You join once, you get every PDF posted during your membership.
Right after payment on our Graphy page, you'll receive a private invite link to the Telegram channel. Access is instant — usually under 30 seconds.
We compile question banks from the actual Lex test pattern, sourced and verified by 180K+ community members who've recently cleared these exams. Match rate is consistently 85–95%.
Every single month. When Infosys rolls out new versions of certifications, we post updated dumps within 7–10 days. You'll see channel activity weekly.
Clearing certifications is one of the highest-weighted DQ factors. Members typically clear 3–5 certifications in their first 3 months, which moves DQ scores up by a full band.