🚀 Join 1,200+ candidates currently preparing with PrimerPrep
Java Programming
Accenture Technical PrimermediumJava Programming3. Class And Objects, Date Api

Accenture Java Programming Practice Question

Observe the code below. public class Student { int studentId; String name; char grade; public Student(int studentId, String name, float mark) { this.studentId = studentId; this.name=name; calculateGrade(mark); } public void calculateGrade(float mark){ if(mark>90) grade='A'; else grade='B'; } } For the code Student s = new Student(1,"Peter",95); What will be the output?

Answer options

A
No output (no print statement in given code)
B
Compile-time error
C
Grade B
D
Grade A

Correct answer: No output (no print statement in given code)

Explanation

Quick AnswerThe correct answer is No output (no print statement in given code) because it directly addresses the core logic of Java Programming.

The code runs without error but includes no print statement, so no output is produced.

Related Accenture Java Programming questions

Practice more Accenture Java Programming questions

PrimerPrep has 1400+ practice questions, 2026 simulations and coding hands-on — all free.

Watch Walkthroughs!