Menu
Question Index
...

Write a program to convert mobile to delimited format.

Input (Mobile Object) Output (Delimited Format String)
NumberOfSims = 1, Maker = "Nokia", Model = "3421", CameraMegaPixels = 2.5 1,Nokia,3421,2.5
NumberOfSims = 2, Maker = "Samsung", Model = "2252", CameraMegaPixels = 1.2 2,Samsung,2252,1.2
NumberOfSims = 2, Maker = "Apple", Model = "C3752", CameraMegaPixels = 12.0 2,Apple,C3752,12.0



class ConvertMobileToDelimitedFormat
{
    public static void main(String s[])
    {
        Mobile mobeen_mobile = new Mobile(1, "Nokia", "3412", 2.5);
        System.out.println("Converted Delimited Format is : " + convertToDelimitedFormat(mobeen_mobile));

    }


    public static String convertToDelimitedFormat(Mobile mobile) {
    String result = null;
    return result;
    }

}
class Mobile {

int numberOfSims;
String maker;
String model;
double cameraMegaPixels;

public Mobile(int numberOfSims, String maker, String model, double cameraMegaPixels) {
this.numberOfSims = numberOfSims;
this.maker = maker;
this.model = model;
this.cameraMegaPixels = cameraMegaPixels;
}
}

Doubts

Problems

Topic: this Keyword In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App