Question: 3. What is the output after executing the following java statements? public class Assig1_3{ public static void main (String[] args) { = String strl
3. What is the output after executing the following java statements? public class Assig1_3{ public static void main (String[] args) { = String strl "Welcome"; String str2="to Java programming"; String str3 strl+str2; System.out.println(str3); System.out.println("The length of \""""+ strl+"\"=" + str1.length()); System.out.println("The length of \"""+ str2+"\"=" + str2.length()); (2 marks) System.out.println("Does \"+ strl+"\" equal to \"+str2+ "\" ? " + strl.equals(str2)); }// end main }//end class 4. Write a Java program that declare length and width as double to calculate the area of a square. Assign values to the declared variables, then calculate the area (area = length * width) and print the result using Print Statement. Hint: length width (3 marks)
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
In the first code snippet public class Assigl3 public static void main String args String str1 Welco... View full answer
Get step-by-step solutions from verified subject matter experts
