Translate

Java Interview Snippets



Java Interview Snippets - Mostly Asked by Interviewer


// 1.  Java Overloading Concepts


Public Class JavaCodeSnippets
{
 public static void PadnaSeekhna(String s)
{
System.out.println("String");
}

 public static void PadnaSeekhna(Object o)
{
System.out.println("Object");
}

public static void main (String a[])
{
PadnaSeekhna(null);
}
}

Whats the Answer ? Will it Compile ? If Yes Whats the Answer  ??


// 2.  Java Overloading Concepts

public class JavaCodeSnippets

public static void PadnaSeekhna(String s) 
System.out.println("String"); 

public static void PadnaSeekhna(Object o) 
System.out.println("Object"); 

public static void PadnaSeekhna(Integer s)
System.out.println("Integer");


public static void main (String args[]) 
{
PadnaSeekhna(null); 
}}

Whats the Answer ? Will it Compile ? If Yes Whats the Answer  ??



// 3.  Interface Concepts


interface JavaCodeSnippets

static class PadnaSeekhna1
{
class PadnaSeekhna2
{
}}}

Will it Compile ??



// 4.  Condition Concepts



if(null==null)
System.out.println("Padne Seekhna");


Will it Compile ?? Comment in the below section











No comments:

Post a Comment