Skip to main content

Posts

Showing posts from April, 2017

Top 100 Java Interview Questions With Answers.

1. What Do You Know About Java? Answer:  Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. 2. What Are The Supported Platforms By Java Programming Language? Answer:  Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX/Linux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc. 3. List Any Five Features Of Java? Answer:  Some features include: Object Oriented. Platform Independent. Robust. Secured & Dynamic. Multi-threaded. 4. Why Is Java Architectural Neutral? Answer:  It’s compiler generates an architecture-neutral object file format, which makes the compiled code to be executable on many processors, with the presence of Java runtime system. 5. How Java Enabled High Performance? Answer:  Java uses Just-In-Time compiler to enable high performance. Just-In-Time

Page VIII - Java Interview Questions With Answers.

176. What Is The Difference Between The Size & Capacity Of A Vector? Answer:  The size is the number of elements actually stored in the vector, while capacity is the maximum number of elements it can store at a given instance of time. 177. Can A Vector Contain Heterogenous Objects? Answer:  Yes a Vector can contain heterogenous objects. Because a Vector stores everything in terms of Object. 178. What Is An Enumeration? Answer: An enumeration is an interface containing methods for accessing the underlying data structure from which the enumeration is obtained. It allows sequential access to all the elements stored in the collection. 179. What Is Difference Between Path & Classpath? Answer: Path and Classpath are operating system level environment variables. Path is defines where the system can find the executables. exe files and classpath is used to specify the location of .class files. 180. Can A Class Declared As Private Be Accessed Outside It's Package?

Page VII - Java Interview Questions With Answers.

151. What Are Order Of Precedence & Associativity & How Are They Used? Answer:  Order of precedence determines the order in which operators are evaluated in expressions. Associativity determines whether an expression is evaluated left-to-right or right-to-left. 152. What Is Type Casting? What Is Downcasting? Can A Double Value Be Cast To A Byte? Answer:  Type casting means treating a variable of one type as though it is another type. Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy. Yes, a double value can be cast to a byte. 153. Which Method Of The Component Class Is Used To Set The Position & Size Of A Component? Answer: setBounds method is used for this purpose. 154. What Is The Range Of The Short Type? Answer: The range of the short type is -2^15 to 2^15 - 1. 155. What Is The Immediate Superclass Of Menu? Answer: MenuItem class 156. Does Java Allow Default Arguments? Answer: No, Java does no

C Program To Compare Two Strings With/Without Using strcmp() Function.

C Program To Compare Two Strings Using strcmp Function #include <stdio.h> #include <string.h> int main() {     char a[100], b[100];     printf("Enter the first string\n");     gets(a);     printf("Enter the second string\n");     gets(b);     if (strcmp(a,b) == 0)         printf("Entered strings are equal.\n");     else         printf("Entered strings are not equal.\n");     return 0; } OUTPUT: Enter the first string Compare Enter the second string Compare Entered strings are equal. C Program To Compare Two Strings Without Using strcmp Function #include <stdio.h> int compare_strings(char [], char []); int main() {     int flag;     char a[1000], b[1000];     printf("Input first string\n");     gets(a);     printf("Input second string\n");     gets(b);     flag = compare_strings(a, b);     if (flag == 0)         printf("Entered strings are equal.\n&q

C Program to Print "Hello World" Without Semicolon/Printf Command

C Program To Print "Hello World". #include <stdio.h> int main() {     // printf() displays the string inside quotation     printf("Hello World");     return 0; } OUTPUT: Hello World C Program To Print "Hello World" Without Using Semicolon. #include <stdio.h> void main() {     if(printf("Hello World"))     { } } OUTPUT: Hello World C Program To Print "Hello World" Using #define. #include <stdio.h> #define PRINT printf("Hello") void main() {     if(PRINT)     { } } OUTPUT: Hello World C Program To Print "Hello World" Without Using printf. #include <stdio.h> main() {     char st[15] = "\nHello World\n";     int n =0;     while(st[n] != '\0')     {         putchar(st[n]);         n++;     } } OUTPUT: Hello World C Program To Print Semicolon Without Using A Semicolon . #include <stdio.h> int main()