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

  Create a jsp that displays the student name

Create a JSP that displays the student name and the current score, given the EMPLID and class ID. For each class, a text file is used to store the student name, EMPLID, and current score

  Design a java application using the list data structure

You are to design a Java application using the list data structure to manage your contact information. Each contact may have the subsequent data:

  Write a method called negative sum

Write a method called negativeSum that accepts a Scanner reading input from a file containing a series of integers, and print a message to the console indicating whether the sum starting from the first number is ever negative

  Create a program called date java to perform

Create a program called Date.java to perform error-checking on the initial values, for instance: fields month, day, and year. Also, provide a method nextDay() to increment the day by one. The Date object should always remain in a consistent state.

  Create a separate class for the selected product

Create a separate class for the selected product that holds the item number, the name of the product, the department in which the product belongs, the number of units in stock, and the price of each unit. You must use the product and class name th..

  Littlest rebel starring shirley temple

Compare the novel Little Women by Louisa May Alcott and the film The Littlest Rebel starring Shirley Temple. How do these two intertwine or influence each other?

  What do you mean by operator overloading

What do you mean by operator overloading

  Java programming arrays

Write a Java application program that takes in user input from keyboard and calculate semester grade based on the scores. In this assignment, you are going to rewrite the program, instead of taking keyboard input, you will use dialog box to prompt..

  Write the code and output result1 real cash register can

write the code and output result.1. real cash register can handle both bills and coins. design a single class that

  Task 1 create a new project in eclipsecreate a package

task 1 create a new project in eclipse.create a package called lsquopeople within this project. download the start up

  Definition of constant initialization arrays

You have to extend the definition of constant initialization arrays to multi-dimensional arrays

  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

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