Java | JSP | JSF Answers

Questions answered by Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

3. The following is an example of __. Please select "A, B, C, D, or E" as correct option. 


class Dog

{

int bark() { ... }

}

class Poodle extends Dog

{

double bark() { ... }

}


A. method overloading

B. method overriding

C. method overloading and overriding

D. class overloading

E. class overriding


2. Given the following code, where does the method overloading happen? Please select "A, B, C, D, or E" as correct option. 


class Parent

{

public int show() { ... }

public int showIt(int x) { ... }

public int showMe() { ... }

public double showHow() { ... }

public void showAgain() { ... }

}

class Child extends Parent

{

public int show(int x) { ... }

public int showIt(int x) { ... }

public int showMe() { ... }

public int showHow() { ... }

public double showHow() { ... }

}


A. the superclass

B. the Parent class

C. the subclass

D. both the Parent and Child class

E. both the superclass and subclass


1. Given the following code, which method is an example of method overloading? Please select "A, B, C, D, or E" as correct option.


class Parent

{

public int show() { ... }

public int showIt(int x) { ... }

public int showMe() { ... }

public double showHow() { ... }

public void showAgain() { ... }

}

class Child extends Parent

{

public int show(int x) { ... }

public int showIt(int x) { ... }

public int showMe() { ... }

public int showHow() { ... }

public double showHow() { ... }

}


A. show()

B. showIt()

C. showMe()

D. showHow()

E. showAgain()


8. Develop a program by designing a class to represent a bank account. Include the 

  following members:

Data Members:

Name of the Depositor

Account Number

Type of account

Balance

Methods:

getdetails( )   ---To assign initial values

deposit( )  ---To deposit an amount

withdraw( ) ---To withdraw an amount after checking balance

display( )--- To display the name and balance.



Write a java program to calculate the income of sales person per week. 

Itemcode

Item Name

Unit Price

Quantity


121

Shampoo

250.45

3


131

Soap

102.16

2


141

Talcum powder

98.23

3


145

Oxford Dictionary

500.24

4



6. Write a java application that inputs an integer containing only 0‘s and 1’s (i.e. a binary integer) and prints its decimal equivalent.



Write a Java application that ask the user to enter two integers, and prints their sum, product, difference and quotient (division).

[Use Scanner class  present in java.util package and nextInt () method to read input].

Write a Java application that inputs from the user the radius of a circle as an integer and prints the circle's diameter, circumference and area using floating point value 3.1459 for pi. You may also use constant Math.PI for the value of pi. Class Math defined in package java.lang.

[Note: Use Scanner class present in java.util package and nextInt () method to red input].


3. Write a Java Application that inputs from the user temperature in Fahrenheit as an float and converts in to its equivalent Celsius temperature and print the result.(Formula:c=(f-32)*5/9)

[Note: Use Scanner class present in java.util package and nextFloat () method to red input].

    


Create a Spending application to help examine the spending patterns of a user. The application should prompt the user for the amount spent last month on food, clothing, entertainment, and rent, and then displays a table showing the percentage of expenditures in each category.



What operation does the Selection Sort use to move numbers from the unsorted section to the sorted section of the list


Write a function to sort array elements using Selection sort in Descending order .also Compute the best case and worst case time complexity of selection sort.


Write java code to print following diamond patterns. This program must take number of lines from user. If even number is entered than program must ask again user to enter odd number.


LATEST TUTORIALS
APPROVED BY CLIENTS