What does this sequence of statements print

Assignment Help JAVA Programming
Reference no: EM13845922

Q1.What do you understand by complier error and run time error? Explain by example.

Q2. What is wrong with the following variable declarations?

int Km/h = 120;

String Newcar = GMC;

int Adouble = "50";

String newCar = "GMC"

int x = 5, y = "x";

String new Car = "GMC";

Q3. What does this sequence of statements print?

String msg = "The number of characters in newCar is";

String newCar = "GMC";

int numberOfCharacters = newCar.length();

String carUpperCase = newCar.toUpperCase();

System.out.print(newCar);

System.out.println(carUpperCase);

System.out.print(msg);

System.out.println(newCar.length());

newCar.replace("C","U");

newCar.replace("M","E");

newCar.replace("G","S");

System.out.print("Welcome to : ");

System.out.println(newCar);

/*System.out.println("Good luck");

System.out.println("to all students");*/

Q4. Consider the following class:

public class IdentifyMyParts
{
private int x = 7;
private int y = 3;
}

a. What are the instance variables?

b. What is the output from the following code:

IdentifyMyParts a = new IdentifyMyParts();
IdentifyMyParts b = new IdentifyMyParts();
a.y = 5;
b.y = 6;
a.x = 1;
b.x = 2;
System.out.println("a.y = " + a.y);
System.out.println("b.y = " + b.y);
System.out.println("a.x = " + a.x);
System.out.println("b.x = " + b.x);

Q5. What is the output of the following code:

a.
int num1 = 6;
int num2 = 10;
num1 = num1 + num2;
num2 = num1 + num2;
System.out.println(num1 + ", " + num2);

b.

int a = 10;
int b = 20;
int c = 2;
int x = b / a /*c*/;

Q6. Write a Java program that performs the following:

1. Identify the radius of the circle. (radius = 3)

2. Calculate circumference and area of the circle.

3. Print the results.

Reference no: EM13845922

Questions Cloud

Calculate the rental fee based on the type of video : The Color option should change the background color of the form; the font changes can change the control of your choice. Set keyboard shortcuts for the menu commands.
Identify the outcome of the change in terms of success : Identify the outcome of the change in terms of success, failures, cultural outcomes, and human resource changes. You should support your ideas with at least three references. Your paper should be 3-5 pages long, well-written.
Prepare the adjusting entries of perez rental agency : Problem: The ledger of Perez Rental Agency on March 31 of the current year includes the selected accounts, shown below, before quarterly adjusting entries have been prepared.
How would you measure efficiency of wheeled coach facility : How would you measure the "efficiency" of Wheeled Coach Facility Layout?
What does this sequence of statements print : What is wrong with the following variable declarations - What does this sequence of statements print
What are opportunities in creating entrepreneurial venture : What are some of the opportunities and challenges in creating an entrepreneurial venture in a foreign market?
Design a production sequence that will meet demand and level : Design a production sequence that will meet demand and level production of the various models.
Find the quadratic polynomial of best fit and graph it : Find the quadratic polynomial of best fit and graph it on the scatterplot. State the formula for the quadratic polynomial.
Create a free trial account : Roto Air has decided to use Smartsheet as the software for project management and collaboration. The Quick Drop 100 Transition team will be the first to use it. You will enter into a self-teaching exercise based on selected project information tha..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Print the initial array and the resulting array

Take an N x N matrix, and create a new, (N-1) x (N- 1), matrix with each element being the sum of four nearby elements. You need to figure out a way to break the matrix up into squares and iterate through the matrix, while staying within its bound..

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  Write a method that will perform the a division operation

Write a method that will perform the a division operation (divide by) on the numbers passed to it in two variables (numerator, denominator) and outputs the results. Use a try-catch pair to output an error message if the illegal operation of divide..

  Describe the applications functionality

Create an application for Koch's Cottages, a weekend getaway resort that rents cottages and boats to use on the local lake - Add labels as suitable to describe the application's functionality. Save the file as JCottageFrame.java.

  Build a thread system

Identify all Nachos classes that you will modify and where you plan to do you modifications - Identify all classes that you plan to implement and give the API for each class,

  Write a recursive method to print all permutations of string

Write a recursive method to print all the permutations of a string. For instance, for a string abc, the printout is: abc acb bac bca cab cba

  Describe the steps to program development

What is the function of parseFloat and parseInt and what will be result if we send "abcd" through a prompt() input and pass it through parseInt()?

  Convert the while loop

Convert the while loop in the following code segment to a do-while loop

  Outline a test plan for a substantial real-life system

Describe how you would approach the design and testing process to ensure success and quality in the result and where are the risks? How are you going to address them?

  Program to find maximum-minimum of sequence of values

Common task which should be done in loop is to find maximum and minimum of sequence of values. File Temps.java contains program which reads in sequence of hourly temperature readings over 24- hour period.

  Write down a program which determines the bonus that must

write a program that determines the bonus that should be paid to employees. bonuses are determined based on the years

  Explain the process of initializing an object

Which method is invoked in a particular class when a method definition is overridden in several classes that are part of an inheritance hierarchy

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