-
-
-
-
-
-
-
-
-
-
-
-
Encapsulation and data abstraction in Java
Can somebody tell me what is the example of encapsulation , data abstraction & polymorphism?
-
-
else if (month==3||month==4||month==5)
season = "spring";
else if (month==6||month==7||month==8)
season = "summer";
else if (month==9||month==10||month==11)
season = "autumn";
else
season = "bogus month";
System.out.println(season);
}
}">Although the output of following is spring, but how can we use the command line argument for the same program? pls solve thisthanks in advanceclass Ifelse{public static void main(String arr[]){int month=4;String season;if (month==12||month==1||month==2)season = "winter";else if (month==3||month==4||month==5)season = "spring";else if (month==6||month==7||month==8)season = "summer";else if (month==9||month==10||month==11)season = "autumn";elseseason = "bogus month";System.out.println(season);}}
-
-
-
-
-
-
Java Interview Questions
Ans