What will the following code segment print on the screen

Assignment Help JAVA Programming
Reference no: EM133152030

Part A: MCQ

Question 1. What is the value of x after following statement is executed, given that int a = 1, int b = 2, int c = 3 and ind d = 4?

boolean x = (c - a - b)<a||(d-c) < a;
a. true
b. false
c. null
d. 0

Question 2. Given the code:
int [] x = new int[3];
x[0] = -1;
x[1]=7;
Which one of the following statements is correct?
a. In x[0]=-1, 0 is the value and -1 is the index of the array element
b. The length of the array x can be obtained from x.length and is 4
c. Statement x[1] = 7; will successfully assign 7 at index 1
d. None of the above

Question 3. Given the following variable declarations:
int x = 18;
int y = 28;

what will the following code segment print on the screen?
boolean a = !((x < 15)||(y> 15));
boolean b = !(x < 15) && (y > 15);
System.out.println("a = "+ a +", b = " + b);
a. a = true, b = true
b. a = true, b = false
c. a = false, b = true
d. a = false, b = false

Reference no: EM133152030

Questions Cloud

Evolution of technology and robots : With the evolution of technology and robots, it soon will be common for a guest to not need to stop at a front desk to check-in.
Constitution revolutionary act : In what ways was the writing and ratification of the Constitution a revolutionary act? In what ways was the Constitution itself a revolutionary document?
Should coca-cola management be concerned : Should Coca-Cola's management be concerned? Discuss why or why not and include references to support your reasoning.
Develop sustainability metrics for charlie chocolate company : Develop sustainability metrics for Charlie's chocolate company. What kinds of issues should be included in the first sustainability report of Charlie's choco
What will the following code segment print on the screen : What is the value of x after following statement is executed, given that int a = 1, int b = 2, int c = 3 and ind d = 4?
What total income or loss from bond investment be reported : At year- end, the entity received annual interest of P120,000 and the fair value of the bonds was P2,823,000. What total income or loss from bond investment
Explain the importance of ensuring the information : Explain the importance of ensuring the information entered into a medical record is correct and complete and meets data quality standards.
Ratification of constitution a revolutionary act : In what ways was the writing and ratification of the Constitution a revolutionary act?
What kinds of metrics were used in puma environment : What kinds of metrics were used in PUMA's Environment profit and loss account? How do these compare to metrics used in traditional P&L statements?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd