Create an interface with a method concatenation, JAVA Programming

Assignment Help:

a)  Using Java, create an interface with a method called concatenation which will be implemented in the class patient in part b.

b)  Using Java, write the class patient with the following:

i)  three private data members: ID, fname and lname.

ii)  A default constructor.  This constructor is used to initialise the data members to null.

iii) Another constructor with the following arguments: ID, fname and lname.  This constructor is used to initialise the data members.

iv) Accessor methods (settors and gettors).

v)  An implementation of the concatenation method.

c)  Write a main class to instantiate the patient class and to output the result of the concatenation.

d)  What will be the output from the following 'switch' statement?

int number = 45;
switch ( number ){
case 35: System.out.print("Hello");
case 45: System.out.print("Good");
case 55: System.out.print("Bye");
default: System.out.print("Hello Good Bye"); }

e)  What will be the value of variable sum after executing the while loop?

int sum = 0, cont = 1;
while (cont <= 10 ) {
sum += cont;
cont +=3;
}


Related Discussions:- Create an interface with a method concatenation

Java program that reads in a file of products, Write a Java program called ...

Write a Java program called SalesInfoMiner that reads in a file of products, stored in text format (2 lines per entry). The program must then read in information about past sales t

Need sms application server, Project Description: A java application is ...

Project Description: A java application is required with the subsequent features 1. Ability to use GSM Modem (and/or Mobile phones) or SMPP to send and receive SMS messages

Difference between hashmap and hash table, Difference between HashMap and H...

Difference between HashMap and Hash table HashMap: It allow us to have null values and also one null key It is Unsynchronized. Iterator in HashMap is Fail-Safe.

What is the point-to-point model in jms, A point-to-point model is based on...

A point-to-point model is based on the concept of a message queue: Senders send messages into the queue, and the receiver reads messages from this queue. In the point-to-point mode

Application for software tracking system, Talent agencies like ICM, CAA and...

Talent agencies like ICM, CAA and Paradigm represent writers, directors and actors (among other talent).  These agencies take in hundreds of millions of dollars a year collecting 1

Inner, #question.Hi, i hope my message find you very well. could you help m...

#question.Hi, i hope my message find you very well. could you help me please with this question . provide an example code for an anonymous inner class. Highlight what makes your e

Test the applet sample , Obtain ONE of the sample applets from Sun Microsys...

Obtain ONE of the sample applets from Sun Microsystems' Applets page, or any other source for free Java applets you may wish to use. Test the applet, and link it to Part 2 of your

What are the core classes of the struts framework, Struts is a set of coope...

Struts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. ? JavaBeans components for managing application state and behavior. ? Eve

Program for convert temprature and length, Public class ConversionProgram {...

Public class ConversionProgram {  public void start() {    String userChoice = askConversionCategory();   while (userChoice.equals("1") || userChoice.equals("2") || Page 2

Which models are supported by jms, Which models are supported by JMS? Pleas...

Which models are supported by JMS? Please, explain them. Ans) Publish or subscribe (pub/sub). This model permits a client (publisher) to send messages to a JMS topic. These mess

Write Your Message!

Captcha
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