Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 11 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text Suppose class A extends class B and has one constructor. In
Question 11
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
Suppose class A extends class B and has one constructor. In which of the following situation the first statement in As constructor must be super()?
B class has no constructors
B class has private fields
B class has only one constructor, which takes parameters
B class has one constructor, which does not take any parameter
Question 12
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
Consider the following block of code.
//class 1
public class PointXY{
private int x,y;
public Point(int x,int y){
this.x=x;
this.y=y; }
public int getX(){ return x;}
public int getY(){return y;}
//class 2
public class Poly{
private ArrayList Po;
public Poly(){ Po=new ArrayList(); }
public void add(Point p){Po.add(p); }
public int getX(int j){ return Missing code };
}
Which of the following code should be place in Missing code in the Poly class?
Po.getX().get(j)
Po.getX(j)
Error
Po.get(j).getX()
Question 13
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
what is the result of the following code.
int i=7, x;
x=Math.sqrt(i/2);
System.out.println(x);
3
Error
3.5
1.7
Question 14
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
The following block of code is used to calculate and display sum of following numbers 7,8,9.25.
int counter=0, sum=0;
while(counter
Question 11 Not yet answered Marked out of 1.00 P Flag question Suppose class A extends class B and has one constructor. In which of the following situation the first statement in A's constructor must be super()? O B class has no constructors O B class has private fields B class has only one constructor, which takes parameters B class has one constructor, which does not take any parameter Question 12 Not yet answered Marked out of 1.00 Flag question Question 12 Not yet answered Marked out of 100 Flag Gestion Consider the following block of code class 1 public class Point private int xy public Point(int x, int y this yay:) public int getxo return x) public int goty){return y:) Mclass 2 public class Poly private ArrayListwhich of the following option is correct?
The output will be sum of 7 till 24, 25 will not include
The total will be 25
The final result will be correct
No Output
Question 15
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
Given following block of code
String str="ALAMAL";
int I=str.substring(1,3).indexOf("A");
what is the value of I?
2
0
1
3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started