Doubtly
@Doubtly · Joined Feb 2021
- Answers
- 3,792
- Questions
- 4,963
- Upvotes received
- 429
- Which of the following is not an OOPS concept in Java? a) Polymorphism b) Inheritance c) Compilation d) Encapsulation Answer: c Explanation: There are 4 OOPS concepts in Java. Inheritance, Encapsulation, Polymorphism and Abstraction. 1
- What will be the output of the following Java program? a) NaN b) Infinity c) 0.0 d) all of the mentioned Answer: d Explanation: For floating point literals, we have constant value to represent (10/0.0) infinity either positive or negative and al... 1
- Which environment variable is used to set the java path? a) MAVEN_Path b) JavaPATH c) JAVA d) JAVA_HOME Answer: d Explanation: JAVA_HOME is used to store a path to the java installation. The environment variable that is commonly used to set the... 2
- What will be the output of the following Java code? Answer: a Explanation: Operator ++ has more preference than *, thus g becomes 4 and when multiplied by 8 gives 32. 1
- What is the extension of java code files? a) .js b) .txt c) .class d) .java Answer: d Explanation: Java files have .java extension. 2
- Which of these cannot be used for a variable name in Java? a) identifier & keyword b) identifier Answer: c Explanation: Keywords are specially reserved words that can not be used for naming a user-defined variable, for example: class, in... 1
- Which one of the following is not a Java feature? a) Object-oriented Answer: b Explanation: Pointers is not a Java feature. Java provides an efficient abstraction layer for developing without using a pointer i... 1
- Which component is used to compile, debug and execute the java programs? a) JRE b) JIT c) JDK d) JVM Answer: c Explanation: JDK is a core component of Java Environment and provides all the tools, executables and binaries required to compile,... 1
- Which statement is true about Java? a) Java is a sequence-dependent programming language Answer: d Explanation: Java is called ‘Platform Independent Language’ as it primarily works on the principle of ‘compile once, run everywher... 1
- Who invented Java Programming? a) Guido van Rossum b) James Gosling c) Dennis Ritchie d) Bjarne Stroustrup Answer: b Explanation: Java programming was developed by James Gosling at Sun Microsystems in 1995. James Gosling is well known as the fathe... 1
- C Program to find Sum of Diagonal Elements of a Matrix #include<stdio.h> int main() int i, j, rows, columns, a[10][10], Sum = 0; printf("n Please Enter Number of rows and columns : "); scanf("%d... 1
- C Program to Find Hcf and Lcm of Two Numbers #include <stdio.h> #include <conio.h> int main() int a, b, num1, num2, temp, gcd, lcm; printf("Enter two numbersn"); scanf("%d %d", &a, &b);... 1
- C Program to Calculate Power of a Number #include <stdio.h> int main() { int base, exp; long double result = 1.0; printf("Enter a base number: "); scanf("%d", &base); printf("Enter... 1
- C Program to Check Armstrong Number #include <stdio.h> #include <conio.h> int main() int number, sum = 0, lastDigit, temp; printf("Enter a number : "); scanf("%d", &number); te... 2
- C programto check whether a word is palindrome or not.. #include<stdio.h> #include<conio.h> #include<string.h> int main() char str[20]; int i, len, temp=0; int flag = 0; printf("Enter a string:");... 1
- C Program to Swap Two Numbers #include <stdio.h> #include <conio.h> int main() int firstNumber, secondNumber, temp; printf("Enter two numbers n"); scanf("%d %d", &firstNu... 1
- C Program to Reverse Digits of a Number #include <stdio.h> #include <conio.h> int main() int number, reverse = 0, rightDigit; printf("Enter a number n"); scanf("%d", &number); whil... 1
- C Program to Check Odd or Even Numbers #include <stdio.h> #include <conio.h> int main() int number; printf("Enter a number n"); scanf("%d", &number); if(number%2 == 1) // Input nu... 2