Menu
Question Index
...

What will be the output of the following program?

public class Balu {
    String song = "Maateraani Chinnadhaani";
    public static void main(String[] args) {
        Balu b = new Balu();
        b.singMelody();
        b.singItem();
        b.singFastTrack();
    }
    private void singMelody() {
        System.out.println("Singing " + song);
    }
    private void singFastTrack() {
        System.out.println("Singing " + song);
        String song = "Guvva Gorinka Thoq";
        System.out.println("Singing " + song);
    }
    private void singItem() {
        String song = "Janavule Nerajanavule";
        System.out.println("Singing " + song);
        singMelody();
        System.out.println("Singing " + song);
    }
}


Singing Maateraani Chinnadhaani
Singing Janavule Nerajanavule
Singing Janavule Nerajanavule
Singing Janavule Nerajanavule
Singing Maateraani Chinnadhaani
Singing Guvva Gorinka Thoq
Singing Maateraani Chinnadhaani
Singing Janavule Nerajanavule
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Singing Guvva Gorinka Thoq
Singing Maateraani Chinnadhaani
Singing Janavule Nerajanavule
Singing Maateraani Chinnadhaani
Singing Janavule Nerajanavule
Singing Maateraani Chinnadhaani
Singing Guvva Gorinka Thoq
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Singing Maateraani Chinnadhaani
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Multiple Methods In One Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App