Popular Articles

The Anglo Sikh wars (1846-49) were the most ferocious battles faced by the British in India. These battles deeply affected the British psyche, with the
I have been wanting to write about the military heroes of the 20th century from India. We have so many great soldiers and airmen who are not remembered
Backwaters are unique tourist attractions of Kerala. Cruising along the marvelous Kerala backwaters on a traditional house boat is one of the best ways

Latest Articles

Backwaters are unique tourist attractions of Kerala. Cruising along the marvelous Kerala backwaters on a traditional house boat is one of the best ways
I have been wanting to write about the military heroes of the 20th century from India. We have so many great soldiers and airmen who are not remembered
The Anglo Sikh wars (1846-49) were the most ferocious battles faced by the British in India. These battles deeply affected the British psyche, with the
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