JAVA- Unit 1
Java and JavaScript are the same programming language, if you know Java, you automatically know JavaScript.
False
Low-Level Programming Languages are languages that are easily understandable by programmers.
False
The Java Virtual Machine (JVM) that is installed in the Windows OS Platform is an EXACT copy of the JVM installed onto the Mac OS Platform.
False
A compiler is a software that is responsible for translating your written program into a form that the Operating System can understand.
A complier
Which of the following is NOT considered an Object Oriented Programming Language?
C
Interpreted language is run by a separate program that interacts with the computer.
Interpreted Language
A powerful and flexible language created by Sun Microsystems, now owned by Oracle, that can be used to create applications and applets (a program that is executed from within another program) that run inside webpages as well as desktop applications.
Java
Level refers to how close to binary code a language is.
Level
"Beautiful" coding, as Santiago Gonzales would put it, is short and concise so if you would give that code to another programmer, he/she would consider it to be well-written code.
Short and Concise
Given this single line of code: double takeHomePay = grossPay - deductions; Which of the following comments best describes the given line of code?
d. // the deductions were taken away from grossPay and was assigned to takeHomePay
The (API) Application Program Interface is a 'pre-existing program' that a programmer can reuse in creating new Java codes. It contains pre-written Java classes and grouped together as packages or libraries.
(API) Application Program Interface
The Java Programming Language uses an interpreter called the Java Virtual Machine (JVM) that gives the Java byte code the ability to run on any Operating System.
(JVM) Java Virtual Machine
Which of the following statements is NOT TRUE about Java?
. Java can only run in Windows
A programming language allows the program to be broken into cell chunks which can be developed by a group of developers.
Chunks
After a successful and an error-free compilation, the Java compiler transforms the Java Source Code into a Java Byte Code.
Java Source Code Java Byte Code
Java is a portable programming language, which means we can 'write the source code once and make it run anywhere '.
Once Anywhere
Java was originally developed by Sun Microsystems and was officially released in 1995 .
Sun Microsystems 1995
A programming language is important because it defines the relationship, semantics and grammar which allows the programmers to effectively communicate with the machines they program.
True
According to John Romero, programming is "Logic-Based Creativity".
True
An installed Java Virtual Machine running on your operating system is needed to be able to run a compiled Java code?
True
Coding, aside from coding itself, can also teach us other life lessons, such as: time management, logic, criticial thinking, and problem solving.
True
Front-End Programming Languages are used to create programs that the users can 'see'. While Back-End Programming Languages are used to handle back-end data processing and database management.
True
If you have a Java-enabled web browser, this means you can execute / run a Java applet on your browser.
True
It is important and highly recommended to put comments after your code, so that other developers can easily understand what is going on with each line of code.
True
Java code written on the Windows Operating System can also be run on the Mac Operating System.
True
Java is a High-Level Programming Language.
True
Java programming language is cross-platform, meaning the source code can be written in one programming language (e.g. Windows) and can be executed in other Operating Systems (e.g. Windows, MacOS or Linux etc.).
True
Knowing how to code in different programming languages is always a good thing, but a good coder should also know how to use the programming language's coding convention.
True
The Java Runtime Environment (JRE) is a subset of the Java Development Kit (JDK)
True
The Java Source Code (.java) can be written and created on any Operating System.
True
The Java source code (*.java) file is the human readable form that we can write and understand, while the Java byte code (.class) file is the created file after a successful compilation. The contents of the Java byte code cannot be understood by the programmer because it takes the form of a low-level language that only machines can understand.
True
When assigning names to variables, it is important to come up with variable names that closely represents the value they will represent, to lessen the confusion.
True
What is a special kind of Java program that is designed to be delivered over the Internet and automatically executed by a Java-compatible web browser?
a. Applet Yes! A Java applet is a special kind of Java program that a browser enabled with Java technology can run. It is not a standalone application.
What is an example of a low level language?
a. Assembly
When you write and successfully compile your Java source code, your Java compiler will create a:
a. Java Byte Code
The Java compiler does not create an object file, but instead it creates a __________ file (.class) which is, essentially, an object file for a virtual machine.
a. Java Virtual Machine (JVM) The Java Virtual Machine (JVM) is an abstract computing machine that enables a computer to run the byte code that had been compiled by the Java compiler.
Java, being one of the compiled languages, creates a low-level code that is a direct result of a successful compilation. What is it called?
a. The .class file or the Java byte code
A programming language serves several purposes: Select one or more:
a. To instruct a computer what to do in a human-readable form. Yes, by the use of many well-written programming languages like Java, we can create a code which resembles the conventional English form to instruct a computer what to do. d. Allows a programmer to structure the instructions into functions, procedures, etc. Programming languages allow us to break down problems into subsections, so we can properly decide which action to take to solve a coding problem.
Match the appropriate comment to the corresponding line of Java code: a. double gwa = 2.71;// initialise the gwa variable b. int result = num1 + num2; //initialise 'result' with the total of num1 and num2 c. counter++; //incruments a value of counter by 1
a. double gwa = 2.71; // initialise the gwa variable b. int result = num1 + num2;//initialise 'result' with the total of num1 and num2 c.counter++;//incruments a value of counter by 1
Here is a sample Java Code Snippet, for documentation purposes we need to put comments on each line of code, you are to match the appropriate comment to the corresponding Java code: a. int num1 = 10, num2 = 20, num3 = 30; //declares and initialises three intiger values b. System.out.println("The result is: " + result); //prints the result to the screen c. int result = compute(num1, num2, num3); //call the compute method and store the returned value to result
a. int num1 = 10, num2 = 20, num3 = 30; //declares and initialises three intiger values b. System.out.println("The result is: " + result);//prints the result to the screen c. int result = compute(num1, num2, num3); //call the compute method and store the returned value to result
Learning to code will enable you to: Select one or more:
b. Create desktop applications c. Create and publish your own mobile apps e. Publish your own website
Putting comments in your code is always good practice, it promotes the following benefits EXCEPT?
b. Creates problems in archiving your application after a clean compilation. This is NOT TRUE. Codes with or without comments can be archived using the same process.
Coders tend to develop bad habits over time, these bad habits cost them time and resources and sometimes frustration. The following are considered BAD habits for a coder, EXCEPT?
b. Creating back up code. This answer is actually a GOOD programming hobbit. Back up is always good, no matter what.
Any type of data that the user provides to the computer to process is:
b. Input Data Yes, anything that we 'supply' or provide to the computer that is required for the program to run correctly is called an "input".
The Java Runtime Environment (JRE) primarily contains:
b. Tools (i.e. java) c. Java API Libraries d. Java Virtual Machine (JVM)
The Java Source Code is saved with what file extension name?
b.java
What is the program that converts your Java Source Code into Java Byte Code?
c. Java Compiler
Does inconsistent naming of variables cause your program to stop working?
c. No it does not.
The following are valid reasons why there are different kinds of programming languages out there, EXCEPT?
c. To discourage people from learning how to code.
Which of the following is NOT TRUE about Assembly languages?
d. Assembly codes are easy to understand
Who is credited as being the creater of Facebook?
d. Mark Zuckerberg
Before having the name "Java", what was it originally called?
d. Oak Yes, the initial programming language was called Oak and was later refined and improved and proceeded to be called Java.
Which of the following is NOT TRUE about Java?
d. Once a Java program is compiled in a specific operating system, it can only run on the same operating system Java is portable, it can be written once and can run in any operating system that has a JVM in it
Any type of data that the computer displays to the user is:
d. Output Data Yes! Anything that the computer displays to us after processing the data is called an "output".
Who is credited as saying?"Everybody in this country should learn to program a computer, because it teaches you how to think."
d. Steve Jobs
What was the name of the company who originally created Java?
d. Sun Microsystems
What is the most difficult part in programming?
d. The logic
What is the Java tool (or the Java Command) that is used to compile an error free Java source file (.java) and creates a Java byte code (.class file)?
d. javac
ccording to Jonathan Buchanan, coding has taught him a couple of things, which of the following should we UNLEARN from his list of coding habbits?
e. bad posture