Study material generic cover image

Summary Introductory Programming

Course
- Introductory Programming
- n/a
- 2017 - 2018
- UCL
- CS
360 Flashcards & Notes
Scroll down to see the PDF preview!
  • This summary
  • +380.000 other summaries
  • A unique study tool
  • A rehearsal system for this summary
  • Studycoaching with videos
Remember faster, study better. Scientifically proven.
Trustpilot Logo

A snapshot of the summary - Introductory Programming

  • Week 0





  • Is it legal to declare multiple variables of the same type on one line? If so, how?
    Yes - 



    , , ..., ; 
  • What is an assignment statement?
    A Java statement that stores a value into a variable's memory location
  • Why will int x = 2.5; raise an error?
    Because x is declared an int variable = it can only store an int value (not a float)
  • Can an int value be stored in a variable of a different data type?
    Yes - an int value can be stored in a variable of type double; a float variable can also accept an int
  • Java has primitive data types and non primitive data types. What are the non primitive data types called? How many are there?
    Types that are not primitive are called object/reference types 

    3
    - strings
    - arrays
    - user defines classes
  • How many bits does a short data type contain?
    16 bits
  • How many bits does a float data type contain?
    32 bits
  • What are the benefits of constraining the size of a variable?
    Optimising memory
  • What is the syntax to declare/initialise multiple variables at once?




    <type> <name> = <value> , <name> = <value> ;

    -> note, you only need to declare the type once
  • Which package do we import the Scanner from?




    import java.util.*;
Read the full summary
This summary. +380.000 other summaries. A unique study tool. A rehearsal system for this summary. Studycoaching with videos.