Karteikarten
Programming
Karten in diesem Stapel (29)
- 1What is machine code?Programming language consisting of binary or hexadecimal instructions the computer can understand directly
- 2What is a high level programming language?- Easier to understand as closer to human language.
- High abstraction to machine code.
- Independent from computer architecture
- Must be converted to machine code before execution - 3What is a low level programming language?- Provides little or no abstraction in relation to machine instructions
- Fast to run
- Complex to understand - 4What is an object oriented language?- Objects used to model real world entities
- Objects define data and methods which can be used on that data
- Objects interact with each other - 5How is a java program executed?Java source code is compiled into java byte code which can be understood and executed by the java virtual machine
- 6What is a class?- A blue print of how an object is to be instantiated
- Fields and methods defined - 7What is a primitive type?- Basic data types built in and understood by the language
- Serve as building blocks of data manipulation - 8What are reference types?- Data type that holds a reference to an object created from class in memory
- 9What is the static modifier?- When a method or data type is declared as static they are associated with the class rather than the object
- Allows use and manipulation without creating instance of class - 10How do you define an array?data_type array_name = new data_type[n]
data_type array_name = {1, 2, ... , n }
data_type array_name = new data_type[] {1, 2, ... , n} - 11What is a formal parameter?- Refers to the variable as found in the method definition
- 12What an actual parameter?- Also known as argument
- Refers to actual input passed through method - 13What is an accessor method?- Also known as getter method
- Returns value of private member variable - 14What is a mutator method?- Also known as setter method
- Used to control changes to value of private member variables - 15What is recursion in context of Java?- A process whereby a method can call itself continuously
- 16What are the two rules of recursive algorithms?1. Must have at least one base case and one recursive case
2. The recursive case must ensure base case is reached eventually - 17What is tail recursion?When there is nothing to do after return statement
- 18What is definition of an algorithm?- Step by step process of solving a problem
- Built up of finite sequence of instructions that always terminates
- Often described using pseudo-code - 19What does inheritance mean?- A new class with additional features is derived from existing base class
- Derived class has access to fields and methods of base class
- Superclass can only have one subclass - 20What is polymorphism?- Ability of an object to take on many forms
- A subclass of a superclass can be assigned to its superclass reference variable - 21What is the abstract modifier?- Class: Can't be instantiated, has to be sublcassed
Method: Has to be implemented by subclass, cant be done in defining class - 22What is an interface?- Can only contain method signatures and fields
- A way of achieving polymorphism
- Used by implementing in some Java class
- All methods must be implemented - 23What is casting?- Allows you to convert one type to another that are in same type hierarchy
- Used when you need access to target types fields and methods - 24What is a class field?Variables associated with the class
- 25What are instance variables?instance variables are created from class fields when a class is instantiated
- 26What is a constant identifier?- Way of mapping an unchangeable value to variable name
- Must be declared final and static - 27What is a class variable?- A static class field
- 28Difference between array and ArrayList?- array: fixed-sized collection, can be multi-dimensional, can hold primitive data types
- ArrayList - can only hold objects, can be added to at runtime, cant be multi-dimensional, allows type-safety - 29What is worst-case (run time) complexity?Indicates the longest running time performed by an algorithm given input size of n
Informationen
- Beschreibung
- Programming Karteikarten am Programming, erstellt von Robin Lee-Delisle am 28/07/2017.
- Erstellt von
- Robin Lee-Delisle
- Aufrufe
- 0
- Bewertung