Skip to main content

IS5103 WEEK-3 QUIZE'S

 

WEEK-3


Q1. An object is an instance of a ________.

A)    class

Q2. The keyword ________ is required to declare a class.

A) class

Q3. Analyze the following code:


class Circle {
private double radius;

public Circle(double radius) {
radius = radius;
}
}

A) The program will compile, but you cannot create an object of Circle with a specified radius. The object will always have radius 0.

Q4. ________ is invoked to create an object.

A) A constructor

Q5. Which of the following statements are true?

A) 

1. A default constructor is provided automatically if no constructors are explicitly declared in the class.

2. The default constructor is a no-arg constructor.

Q6. Which of the following statements are true?

A) 

1. Constructors are invoked using the new operator when an object is created.

2. Multiple constructors can be defined in a class.

3. Constructors must have the same name as the class itself.

4. Constructors do not have a return type, not even void.

Q7. What is the value of times displayed?


public class Test {
public static void main(String[] args) {
Count myCount = new Count();
int times = 0;

for (int i=0; i<100; i++)
increment(myCount, times);

System.out.println(
"myCount.count = " + myCount.count);
System.out.println("times = "+ times);
}

public static void increment(Count c, int times) {
c.count++;
times++;
}
}

class Count {
int count;

Count(int c) {
count = c;
}

Count() {
count = 1;
}
}

A) 0

Q8. Given the following code fragment

String strA = "aBcDeFg";
String strB = strA.toLowerCaseegg;
strB = strB.toUpperCaseegg;
String strC = strA.toUpperCaseegg;


A) strB.compareTo(strC) would yield 0

Q9. What is the advantage of putting an image in a JLabel instance?

A) It becomes part of the component and is laid out automatically

Q10. These two ways of setting up a String yield identical results:

a) String string = new String("123.45");
b) String string = "" + 123.45;

A) TRUE
































Comments

Popular posts from this blog

IS5213 Data Science and Big Data Solutions

WEEK- 2 code  install.packages("dplyr") library(dplyr) Rajeshdf = read.csv('c:\\Insurance.csv') str(Rajeshdf)                        str(Rajeshdf) summary(Rajeshdf) agg_tbl <- Rajeshdf %>% group_by(Rajeshdf$JOB) %>%    summarise(total_count=n(),             .groups = 'drop') agg_tbl a = aggregate( x=Rajeshdf$HOME_VAL, by=list( Rajeshdf$CAR_TYPE), FUN=median, na.rm=TRUE ) a QUIZ 2. What famous literary detective solved a crime because a dog did not bark at the criminal? A). Sherlock Holmes 1.  In the Insurance data set, how many Lawyers are there? A).  1031 3. What two prefixes does the instructor use for variables when fixing the missing values? Select all that apply. A). IMP_ M_ 4. What is the median Home Value of a person who drives a Van? A).  204139 5. In the insurance data set, how many missing (NA) values does the variable AGE have? A) 7   1. What...

GE5103-2 Project Management [Aug 23 Syllabus]

    Some of the advantages of using time boxes and cycles in project coordination efforts include creating urgency, measuring progress, and allowing for predictable measurements. A)        True 2.    Even though most project managers are not contract specialists, they need to understand the process well enough to coordinate with the team. For the current assignment, you are looking at a short-term and small effort with a contractor of just a few hours without significant clarity. Which of the following would be the most applicable contract to use in this situation? A)        Time and materials 3. The project you are working on has had modifications to the plan from the start and even how the project is run. Project governance covers all of the 3 following except: A)        Naming The project manager 4. Of the following, which is most likely a trigger condition defined early in t...

GE5093 Design Thinking All Quizzes

  GE---5093-1D2-FA-2021 - Design Thinking Home My courses 2021-FA GE---5093-1D2-FA-2021 Week 1 Reading Quiz 1 Started on Sunday, October 31, 2021, 2:04 PM State Finished Completed on Sunday, October 31, 2021, 2:30 PM Time taken 25 mins 58 secs Grade 8.00  out of 10.00 ( 80 %) Top of Form Question  1 Correct 1.00 points out of 1.00 Flag question Question text A critical finding of Edward Lorenz related to Design Thinking was: Select one: a. An application of the caterpillar effect b. The idea of deterministic chaos or the "Butterfly Effect" c. Business leaders enjoy chaos d. Statistical modeling of weather was fairly accurate in the long term Feedback Your answer is correct. The correct answer is: The idea of deterministic chaos or the "Butterfly Effect" Question  2 Incorrect 0.00 point...