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

  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