GoConqr has a new look! Let us know what you think.

Flashcards

Introduction to Computer Science 201 Midterm Flashcards

Carlos Guzman Valencia English 5 cards

Cards in this deck (5)

  1. 1Which keyword do we need to specify in order to access another class from another package?Import
  2. 2Explain the difference between a String variable and a String literal.String literals are hard coded text enclosed with double quotation marks, e.g: “Hello World”. A
    String variable is a variable that holds a string literal. E.g: String name = “Anson”;
    System.out.println(name) is different than System.out.println(“name”)
  3. 3Explain why you must declare every variable in Java before you can reference itBe
    cause the Java compiler won’t know what the undeclared variable is. It needs to check what
    it’s data type is.
  4. 4Explain what truncation is and when it occurs.Truncation is where the floating points of a numeric type are cut off from the number, and
    only the integer part remains. For example, 5/9 = 0.555
    555... but because 5 and 9 are both
    integers, the .55555... is truncated and the result leaves you with 0
  5. 5What is the result of 5/0? How about 5.0/0?5/0 will result in a run-time error somewhere in the program. 5.0/0 will result in infinity

Information

Description
Flashcards on Introduction to Computer Science 201 Midterm Flashcards, created by Carlos Guzman Valencia on 14/10/2018.
Views
2
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?