1. What is the output of this code ?
//List to hold of instance of COntact
List<Contact> contacts = new List<Contact>();
//Add to records of contact in list
contacts.add(new Contact(LastName = 'ICICI', Email = 'noreply@icici.com'));
contacts.add(new Contact(LastName = 'PNB', Email = 'noreply@pnb.com'));
//Insert Contact List
insert contacts;
List<Contact> con = [select Id, Email from Contact where LastName = 'AXIS'];
if(con.size() > 0 & con[0].LastName == 'AXIS'){
System.debug('Execute');
} else {
System.debug('Not Execute');
}
2. What is the output of this code ?
public class A{
public A(){
System.out.print("X");
}
}
public class B extends A {
public B(){
System.out.print("Y");
}
public static void main(String[] a){
A b = new B();
}
}
3. What is the output of this code ?
class Test{
public static void main(){
int x = 8;
System.out.print(++x*3+" " +x);
}
}
4. What is the output of this code ?
class Test{
public static void main(){
int x = 7;
x = ++x+ x++ - ++x;
System.out.print("x is = " +x);
}
}
5. What is the output of this code ?
class Test{
public static void main(){
int x = 4,y;
y = ++x + x++;
System.out.print(x +" "+y);
}
}
6. What is the output of this code ?
for(int i = 0; i < 8 ; i++){
if(i == 2){
i++;
continue;
}
if(5*i == 20) break;
else System.out.print( 5*i);
}
7. What is the output of this code ?
class Test{
public static void main(){
int a = 2,b,c;
b = a++;
c = ++b;
a = b++ * c++;
System.out.print(a);
}
}
8. What is the output of this code ?
class PassS
{
public static void main(String [] args)
{
PassS p = new PassS();
p.start();
}
void start()
{
String s1 = "slip";
String s2 = fix(s1);
System.out.println(s1 + " " + s2);
}
String fix(String s1)
{
s1 = s1 + "stream";
System.out.print(s1 + " ");
return "stream";
}
}
9. What is the output of this code ?
public void test(int x)
{
int odd = 1;
if(odd)
{
System.out.println("odd");
}
else
{
System.out.println("even");
}
}
10. How to create salesforce connection in javascript ?
Answer
1. Exception
2. XY
3. 27 9
4. x is = 6
5. 6 10
6. 05
7. 9
8. slipstream slip stream
9. Compilation fail
10. sforce.connection
//List to hold of instance of COntact
List<Contact> contacts = new List<Contact>();
//Add to records of contact in list
contacts.add(new Contact(LastName = 'ICICI', Email = 'noreply@icici.com'));
contacts.add(new Contact(LastName = 'PNB', Email = 'noreply@pnb.com'));
//Insert Contact List
insert contacts;
List<Contact> con = [select Id, Email from Contact where LastName = 'AXIS'];
if(con.size() > 0 & con[0].LastName == 'AXIS'){
System.debug('Execute');
} else {
System.debug('Not Execute');
}
2. What is the output of this code ?
public class A{
public A(){
System.out.print("X");
}
}
public class B extends A {
public B(){
System.out.print("Y");
}
public static void main(String[] a){
A b = new B();
}
}
3. What is the output of this code ?
class Test{
public static void main(){
int x = 8;
System.out.print(++x*3+" " +x);
}
}
4. What is the output of this code ?
class Test{
public static void main(){
int x = 7;
x = ++x+ x++ - ++x;
System.out.print("x is = " +x);
}
}
5. What is the output of this code ?
class Test{
public static void main(){
int x = 4,y;
y = ++x + x++;
System.out.print(x +" "+y);
}
}
6. What is the output of this code ?
for(int i = 0; i < 8 ; i++){
if(i == 2){
i++;
continue;
}
if(5*i == 20) break;
else System.out.print( 5*i);
}
7. What is the output of this code ?
class Test{
public static void main(){
int a = 2,b,c;
b = a++;
c = ++b;
a = b++ * c++;
System.out.print(a);
}
}
8. What is the output of this code ?
class PassS
{
public static void main(String [] args)
{
PassS p = new PassS();
p.start();
}
void start()
{
String s1 = "slip";
String s2 = fix(s1);
System.out.println(s1 + " " + s2);
}
String fix(String s1)
{
s1 = s1 + "stream";
System.out.print(s1 + " ");
return "stream";
}
}
9. What is the output of this code ?
public void test(int x)
{
int odd = 1;
if(odd)
{
System.out.println("odd");
}
else
{
System.out.println("even");
}
}
10. How to create salesforce connection in javascript ?
Answer
1. Exception
2. XY
3. 27 9
4. x is = 6
5. 6 10
6. 05
7. 9
8. slipstream slip stream
9. Compilation fail
10. sforce.connection
Bhavi Sharma, Bs ye question nhi yad aa rhe or sb aate h mujhe : Subhash Garhwal |
Yr Subhash same mere sath ho rha h : Bhavi Shankar Sharma |
Congratulations to Deepak Kumawat For winning. |
Comments
Post a Comment