Menu
Question Index
...

What will be the output of the following program? Assume that we run LittleFlowerSchool class.

package com.mc.details;
import com.mc.Stud1.Student;
import com.mc.Stud2.StudentDetails;
public class LittleFlowerSchool {
    public static void main(String[] args) {
        Student std = new Student();
        System.out.println("Rank is " + std.rank);
        System.out.println("Marks is " + std.marks);
        System.out.println(StudentDetails.address);
    }
}
package com.mc.Stud1;
public class Student {
    public int rank = 10;
    public double marks = 89;
}
package com.mc.Stud2;
public class StudentDetails {
    public static String address = "Hyderabad, Andhra Pradesh, India";
}


(EMPTY)
Rank is 10
Marks is 89.0
Hyderabad, Andhra Pradesh, India
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Package

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App