WEEK 1 - Java building blocks: data types, expressions and controls Flashcards
1
Q
How can we run Java programs in the absence of an IDE ?
A
- The default approach is using the command line user interface
- The command to compile Java source code is javac
- The command to run the Java program is java
2
Q
Compiling and running Java programs outline:
A
3
Q
Object - orientated programming (oo programming)
A
- Involves defining classes and then creating objects from those classes
-
Objects: Parts that the model is built up form are the objects that appear in the problem domain.
- Represented in a computer program by chunks of computer code.
- Need to define what information the object will hold (attributes) and what is capable of doing -> Defining a Class
- Class file: Where we write the code to specify the attributes (info to be held) and methods (what objects can do).
-
Objects: Parts that the model is built up form are the objects that appear in the problem domain.
4
Q
Problem domain
A
A problem domain is the area of expertise or application that needs to be examined to solve a problem. A problem domain is simply looking at only the topics you are interested in, and excluding everything else.
5
Q
Structure of Java Code
A
In Java few rules about the order in which you choose to define the fields and methods within a class
* Important to chose a style and be consistent so it’s easier to read and understand *
6
Q
Main Method
A
7
Q
Declaring and initialising variables
A
8
Q
Assigning values to variables
A
9
Q
A