Question: Question 1: What is up-casting and what is down-casting? Explain it by using examples with code. Question 2: What is polymorphism? What are required to
Question 1:
What is up-casting and what is down-casting? Explain it by using examples with code.
Question 2:
What is polymorphism? What are required to implement polymorphism?
Question3:
Implement a method to count number of a and A in the string, for example, if the string is String str = "ab12cd1A4"; the number of a and A in str is 2.
public class StringManipulation {
public static void main(String[] args) {
}
// implement this method
public static int numberofAs (String str) {
}
}
Question 4:
What are the differences between FlowLayout and BorderLayout?
Answer:
What is the default layout manager of JFrame and JPanel, respectively?
Answer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
