Introduction To Java Flashcards
What is a method?
A method is a block of code or collection of statements grouped together to perform a certain task or operation.
what are scope in Java?
The scope of a variable is the part of the program where the variable can be referenced/ used
what is Anonymous Array?
An array without a variable referencing it.
new int [] {1, 2 , 3, 4};
what are local variable?
A variable defined inside a method is called a local variable
what is a void method in Java?
A void method is a method that does not return a value
What is variable length Argument list?
A feature that allows a function to receive any number of arguments.
what are value returning method?
A method that return a value.
the return type is the type of the data that will be returned.
what is the return keyword in Java?
A keyword that can be used to return a value from a method.
name the types of method in Java?
the types of method in Java are :
1. predefined method method that is already defined in the Java class libraries .
- User-defined method the method written by the user or programmer .
what is null in Java?
the value of an object that references nothing.
eg: String name; // null
what are Array?
A collection of variable of he same data type.
An array in java is an object.
An array variable references a group of data
the size of an array is fixed
what are parameter in Java?
parameter refers to the list of variables in a method declaration
parameter is a variable used to define a particular value during a function definition
what are arguments in Java?
Arguments are actual value passed into the method when the method is invoked or called
what are method overloading?
method overloading is writing the same method with different parameter.
what are Loops used for?
Loop are used to execute a block of code more than once.
what are the types of Loop in Java?
the types of loops in java are:
1. while loop
2. do-while loop
3. for loop
4. for each loop
what are while loop in java?
while Loop is a control flow statement that executes code repeatedly based on a given Boolean expression.
what is a infinite Loop?
A Loop which continues iterating indefinitely and never stops .
what is an IF Statement?
An IF Statement is used to execute a piece of code based on a condition
what is the Else Statement?
An optional block of an if statement
what is the break keyword?
exist the loop regardless of the condition.
what is the continue keyword?
skips the rest of the loop’s body Continue executing the loop as if we finished executing the body.
what are programming languages?
Programming languages are languages used to write computer program
what is a program?
Program is set of instruction written in specific programming languages that tell the computer what to do or how to complete a task.
what are machine language?
Machine language: A computer’s native language. Uses zeros & ones (0/1) the binary languages to add 2 and 3 and get the result.
Machine language is very hard to use. Machine dependent which means differs among different types of machines. Every instruction should be written in machine language before it can be executed.
All instruction written in other programming languages must be translated to machine code instructions.
what are assemble language?
Assembly language: was developed to make programming easier. Machine dependent.
Introduced keyboards/ add, sub,
A program called “assembler” translates assembly code to machine code.