Persistent Placement Papers Question Answers

  • Upload
    deepesh

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

  • 7/24/2019 Persistent Placement Papers Question Answers

    1/9

    Persistent Placement Papers Question

    answers

    What are callable collections in Java ?

    A callable collection is an interface whose implementers define a

    single method with no arguments. The Callable interface resembles

    Run able, as both are designed for the classes which potentially

    executed with another thread. The difference is Run able cannot

    return value and throw an exception.

    How to make a method thread safe without using synchronized

    keyword ?

    By using a flag to determine that the method is in use by a

    running thread.

    Ex !

    Class A"

    private boolean in#se $ false%

    public methodA&'"

    if&(in#se'"

    in#se $ true%

    ...

    ...

    ...

    in#se $ false%

    )

  • 7/24/2019 Persistent Placement Papers Question Answers

    2/9

    )

    )

    *ou can also use built!in

    synchroni+ers. -ava.util.concurrent.locs.Reentrant/oc0 has the

    same functionality as the loc you access when

    using synchroni+ed blocs and methods, and it is even more

    powerful.

    What is the purpose of sharepoint ?

    1rgani+ations use 2hare3oint to create websites. *ou can use it as

    a secure place to store, organi+e, share, and access information

    from almost any device. All you need is a web browser, such as

    4nternet Explorer, Chrome, or 5irefox.

    Write a script of generate n prime numbers ? #include

    main()

    {

    int n, i = 3, count, c;

    printf("Enter the number of prime numbers required\n"); scanf("%d",&n);

    if ( n >= 1 )

    {

    printf("First %d prime numbers are :\n",n);

    printf("2\n");

    }

    for ( count = 2 ; count

  • 7/24/2019 Persistent Placement Papers Question Answers

    3/9

    {

    printf("%d\n",i);

    count++;

    }

    i++; }

    return 0;

    6rite a program to print reverse of a number and chec whether it is

    palindrome or not 7 #include

    intmain(){

    intnum,r,reverse=0,temp;

    printf("Enter an num!er ");

    scanf("d",$num);

    %hile(num){

    r=num&0;

    reverse=reverse'&0r;

    num=num&0;

    *

    printf("+eversed of num!er d",reverse); return0;

    * Temp = num;

    if(temp ==reverse)

    printf("Number is a palindrome \n");

    else

    printf("Number is not a palindrome \n");

    }

    6rite a program to chec whether the entered year is leap year ornot 7

    #include

    intmain()

    {

    intear;

  • 7/24/2019 Persistent Placement Papers Question Answers

    4/9

    printf("Enter a ear to chec if it is a leap ear\n");

    scanf("d",$ear);

    if(ear-00==0)

    printf("d is a leap ear.\n",ear);

    elseif(ear&00==0)

    printf("d is not a leap ear.\n",ear);

    elseif(ear-==0)

    printf("d is a leap ear.\n",ear);

    else

    printf("d is not a leap ear.\n",ear);

    return0;

    *

    How many requests will be send to server and response

    coming from server when you open a web page (e.g.

    yz.php! which has an image tag? 8 image tag re9uests and : head tag re9.

    "plain # $est %etrics ?

    The below metrics are used for evaluating application system

    testing.

    :. &ser participation(user participation test time divided by totaltest time! ;etric identifies the user involvement in testing.

  • 7/24/2019 Persistent Placement Papers Question Answers

    5/9

    5. $est'utomation(cost of manual test effort versus total test cost!)

    ;etric shows the percent of testing performed manually and that

    performed automatically.

    "plain the pros and cons of testing the software by evelopment

    team and by $esting team ?

    4f testing is done by development team they may fail to catch bugs

    because

    :' They don>t have time to test the software.

  • 7/24/2019 Persistent Placement Papers Question Answers

    6/9

    printf("not on same line");

    }

    Write a program to reverse a string (+ove is ,od becomes

    ,od is love!. [email protected]

    [email protected]

    4nt main&'

    "

    Char strD%

    4nt i , - , %

    3rintf&FnEnter the stringFt0'%

    5flush&stdin'%

    Gets&str'%

    3uts&str'%

    5or&i$D%stri($>FD>%iHH'%

    5or&$4%D%!!'

    "

    4f&str$$>>II $$i'

    "

    5or&-$!:%&str-($>>'JJ&-($!:'%-!!'%

  • 7/24/2019 Persistent Placement Papers Question Answers

    7/9

    "

    6hile&HH-($'

    "

    3rintf&Kc0,str-'%

    )

    3rintf& 0'%

    )

    )

    )

    3rintf&Fn0'%

    )

    What do you mean by platform independent in -ava ?

    Lava is platform independent language because of the bytecode

    magic of -ava. 6hen we execute the source code, it generates the

    .class0 file comprising the bytecodes. Bytecodes are easily

    interpreted by LM; which is available with every type of 12 we

    install.

    6hereas C and CHH are compiled languages which maes them

    platform dependent. The source code written in CNCHH gets

    transformed into an ob-ect code which is machine and 12

    dependent. That>s the reason why C and CHH languages are termed

  • 7/24/2019 Persistent Placement Papers Question Answers

    8/9

    as platform dependent.

    4n the following code, how many times does the foo&'0 is called 7

    for&i $ :% i@$:DD%iHH'

    for&-$ i%-@$:DD%-HH'

    foo&'%

    Answer O DD times.

    Bco+ it will follow the pattern !

    i -

    : : to :DD $ :DDtimes

    < < to :DD $ PPtimes

    = = to :DD

    8 8 to :DD

    to :DD

    Q Q to :DD

    ..

    .

    PP PP to :DD

  • 7/24/2019 Persistent Placement Papers Question Answers

    9/9

    :DD :DD

    Thus, :HPP,