Popular Articles

Pakistan is the obverse image of India and has similar roots.The Pakistan army also has a shared history with the British Indian army and some of the Muslim
Introduction: There is remarkable growth of economic and financial sectors of China in the last two decades. There is no other country that saw such a
The history of the Roman Empire reads like a storybook, chilling and exciting. There was murder, intrigue, love and betrayal. Yet despite all this, it

Latest Articles

Pakistan is the obverse image of India and has similar roots.The Pakistan army also has a shared history with the British Indian army and some of the Muslim
Introduction: There is remarkable growth of economic and financial sectors of China in the last two decades. There is no other country that saw such a
The history of the Roman Empire reads like a storybook, chilling and exciting. There was murder, intrigue, love and betrayal. Yet despite all this, it
John has written the following program which prints the below message.

"I am developer 1
You are developer 2"

public class Main {
public static void main(String[] args){
System.out.println("I am --> "+Programmers.Developer1.getMyName());
System.out.println("You are --> "+Programmers.Developer2.getMyName());
}
}
class Programmers{
static class Developer1{
static String getMyName(){
return "Developer 1";
}
}
    static class Developer2{
static String getMyName(){
return "Developer 2";
}
}
}

requirements has changed and he has to print the below message.

"I am developer 2
You are developer 1"

The specifications/rules are given as below:
1) The solution should be done with minimal changes
2) No modifications are allowed to the Main, Developer1 and Developer2 classes

Try if you can do it. Else watch this space for the answer soon...
  • No comments found