100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Java questions and answers well illustrated.

Rating
-
Sold
-
Pages
8
Grade
A
Uploaded on
12-09-2023
Written in
2023/2024

Java questions and answers well illustrated. What do real world objects contain? - correct and behavior Where is a software object's state contained? - correct s (Java) or variables (C++) Where is a software object's behavior exposed? - correct ds (Java) or functions (C++) Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data... - correct sulation A blueprint for a software object is called a... - correct Common behavior can be defined in a ___ and inherited into a ___ using the ___ keyword. - correct class, subclass, extends A collection of methods with no implementation is called an ___. - correct face A namespace that organizes classes and interfaces by functionality is called a ___. - correct ge The term API stands for ___? - correct cation programmer interface The term "instance variable" is another name for... - correct -static field - instance variables are specific to an object The term "class variable" is another name for ___. - correct c field - class variables are fixed and global across all instances of the class A local variable stores temporary state; it is declared inside a ___. - correct d - for example a counter in a loop int i=0; A variable declared within the opening and closing parenthesis of a method signature is called a ____. - correct eter What are the eight primitive data types supported by the Java programming language? - correct short long float double int char boolean Character strings are represented by the class ___. - correct .String An ___ is a container object that holds a fixed number of values of a single type. - correct Consider the following code snippet. arrayOfInts[j] > arrayOfInts[j+1] Which operators does the code contain? - correct rative operator "greater than" > arithmetic operator "plus" + Consider the following code snippet. int i = 10; int n = i++%5; a) What are the values of i and n after the code is executed? b) What are the final values of i and n if instead of using the postfix increment operator (i++), you use the prefix version (++i))? - correct answers.a) i=11, n=0 b) i=11, n=1 To invert the value of a boolean, which operator would you use? - correct answers."!" logical complement operator Which operator is used to compare two values, = or == ? - correct answers.== = is an assignment operator Explain the following code sample: result = someCondition ? value1 : value2; - correct someCondition is true then assign value1 to result else if someCondition is false then assign value2 to result In the following program, explain why the value "6" is printed twice in a row: class PrePostDemo { public static void main(String[] args){ int i = 3; i++; Sln(i); // "4" ++i; Sln(i); // "5" Sln(++i); // "6" Sln(i++); // "6" Sln(i); // "7" } } - correct answers.i++ is a postfix operator. 1 will be added to 1 after it's printed. ++i is a prefix operator. If it had been used, the println would have been "7" What is a compound assignment operator? - correct answers.You can also combine the arithmetic operators with the simple assignment operator to create compound assignments. For example, x+=1; and x=x+1; both increment the value of x by 1. The most basic control flow statement supported by the Java programming language is the ___ statement. - correct then The ___ statement allows for any number of possible execution paths. - correct h The ___ statement is similar to the while statement, but evaluates its expression at the ___ of the loop. - correct while end How do you write an infinite loop using the for statement? - correct ( ; ; ) { //do something } How do you write an infinite loop using the while statement? - correct (true) { //do something } Consider the following code snippet. if (aNumber >= 0) if (aNumber == 0) Sln("first string"); else

Show more Read less
Institution
Java
Course
Java









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Java
Course
Java

Document information

Uploaded on
September 12, 2023
Number of pages
8
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
techgrades havard university
View profile
Follow You need to be logged in order to follow users or courses
Sold
300
Member since
2 year
Number of followers
101
Documents
12058
Last sold
20 hours ago
TECHGRADES

NURSING SCHOOL IS HARD AM HERE TO SIMPLIFY THE INFORMATION AND MAKE IT EASIER!! My mission is to be your light in the dark, if you are worried or having trouble in nursing school, i really want my notes to be your guide, stay with me and you will find everything you need to study and pass any tests, quizzes and exams! Assisting students with quality work is my first priority. I know how frustrating it can get with all those assignments mate! I have essential guides that are A graded. Get verified solutions from TECHGRADES.

Read more Read less
4.0

68 reviews

5
37
4
7
3
16
2
4
1
4

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions