public class Program
{
public static void main(String[] args) {
try{
int sum=5;
for(int i=-1;i<5;++i){
sum=sum/i;
}
}catch(ArithmeticException e){
System.out.println("0");
}
System.out.println(sum);
}
}
{
public static void main(String[] args) {
try{
int sum=5;
for(int i=-1;i<5;++i){
sum=sum/i;
}
}catch(ArithmeticException e){
System.out.println("0");
}
System.out.println(sum);
}
}
Which method will contain the block of code to be executed when thread starts?
Anonymous Quiz
37%
Main
26%
Start
7%
Execute
30%
Run
public class Program
{
static double overloadedMethod(int i,double d){
return d *= i;
}
static double overloadedMethod(double d,int i){
return i += d;;
}
public static void main(String[] args) {
System.out.println(overloadedMethod(100,100));
}
}
{
static double overloadedMethod(int i,double d){
return d *= i;
}
static double overloadedMethod(double d,int i){
return i += d;;
}
public static void main(String[] args) {
System.out.println(overloadedMethod(100,100));
}
}
Options For above program
Anonymous Quiz
32%
Compilation Error
24%
Runtime Error
28%
10000
12%
10000.0
4%
200
For listing the objects within an ArrayList, which of the following options are available.
1) An Iterator
2) A ListIterator 3) An Enumeration
1) An Iterator
2) A ListIterator 3) An Enumeration
Anonymous Quiz
8%
1
31%
1 and 2
54%
1 and 2 and 3
8%
1 and 3
class Parent{
public int index=1;
}
public class Program extends Parent
{
public Program(int index){
index=index;
}
public static void main(String[] args) {
Program p=new Program(10);
System.out.println(p.index);
}
}
public int index=1;
}
public class Program extends Parent
{
public Program(int index){
index=index;
}
public static void main(String[] args) {
Program p=new Program(10);
System.out.println(p.index);
}
}
public class Program
{
int val;
public Program(int _val){
val=_val;
}
public static void main(String[] args) {
Program p=new Program();
Program p=new Program(10);
}
}
{
int val;
public Program(int _val){
val=_val;
}
public static void main(String[] args) {
Program p=new Program();
Program p=new Program(10);
}
}
Options for above program
Anonymous Quiz
35%
Compilation error due to missing default constructor
20%
Compilation error due to constructor having a return type
35%
Compilation error due to missing parameterized constructor
10%
No Compilation Error. Object a has Val value of 0(zero) while object b has val value of 20
import java.util.ArrayList;
public class Program
{
public static void main(String[] args) {
ArrayList a=new ArrayList();
a.add("C");
a.add("E");
a.add("B");
a.add("D");
a.add("A");
a.add("Z");
a.add("M");
a.remove(1);
a.remove(3);
a.add(2,a.get(3));
a.add(a.size()+" ");
a.remove(3);
System.out.println(a);
}
}
public class Program
{
public static void main(String[] args) {
ArrayList a=new ArrayList();
a.add("C");
a.add("E");
a.add("B");
a.add("D");
a.add("A");
a.add("Z");
a.add("M");
a.remove(1);
a.remove(3);
a.add(2,a.get(3));
a.add(a.size()+" ");
a.remove(3);
System.out.println(a);
}
}
Options for above program
Anonymous Quiz
11%
E,A,B,Z,M,6
29%
E,A,Z,M,5
18%
C,A,Z,M,5
25%
C,B,Z,Z,M,6
18%
None of these
import java.util.ArrayList;
public class Program
{
public static void main(String[] args) {
String s1="Hello World";
String s2=new String("Hello World");
String s3=s2.intern();
System.out.println((s1==s2)+" "+(s2==s3)+" "+(s1==s3));
}
}
public class Program
{
public static void main(String[] args) {
String s1="Hello World";
String s2=new String("Hello World");
String s3=s2.intern();
System.out.println((s1==s2)+" "+(s2==s3)+" "+(s1==s3));
}
}
Options for above program
Anonymous Quiz
24%
False false false
38%
True true true
24%
False true true
14%
False false true
import java.util.ArrayList;
public class Program
{
public static void main(String[] args) {
int i=0;
char[] chArray=new char[20];
chArray={'a','b','c'};
System.out.println(chArray[i = +2]});
}
}
public class Program
{
public static void main(String[] args) {
int i=0;
char[] chArray=new char[20];
chArray={'a','b','c'};
System.out.println(chArray[i = +2]});
}
}
Consider the following code fragment
Rectangle r1 = new Rectangle();
r1.setColor(Color.blue); Rectangle r2 = r1; r2.setColor(Color.red); After the above piece of code is executed, what are the colors of r1 and r2 (in this order)?
Rectangle r1 = new Rectangle();
r1.setColor(Color.blue); Rectangle r2 = r1; r2.setColor(Color.red); After the above piece of code is executed, what are the colors of r1 and r2 (in this order)?
Anonymous Quiz
30%
17%
17%
0%
None of the above.
What is the type and value of the following expression? (Notice the integer division)
-4 + 1/2 + 2*-3 + 5.0
-4 + 1/2 + 2*-3 + 5.0
Anonymous Quiz
11%
int -5
48%
double -4.5
11%
int -4
22%
double -5.0
7%
None of the above.
All Technical Languages PDF A to Z
1- .NET FRAMEWORK-
https://books.goalkicker.com/DotNETFrameworkBook/
2- Algorithms-
https://books.goalkicker.com/AlgorithmsBook/
3- Android-
https://books.goalkicker.com/AndroidBook/
4- Angular 2
https://books.goalkicker.com/Angular2Book/
5- Angular JS
https://books.goalkicker.com/AngularJSBook/
6- BASH
https://books.goalkicker.com/BashBook/
7- C
https://books.goalkicker.com/CBook/
8- C++
https://books.goalkicker.com/CPlusPlusBook/
9- C#
https://books.goalkicker.com/CSharpBook/
10- CSS
https://books.goalkicker.com/CSSBook/
11- Entity Framework-
https://books.goalkicker.com/EntityFrameworkBook/
12- Excel VBA
https://books.goalkicker.com/ExcelVBABook/
13- GIT
https://books.goalkicker.com/GitBook/
14- Haskell
https://books.goalkicker.com/HaskellBook/
15- Hibernate
https://books.goalkicker.com/HibernateBook/
16- HTML 5
https://books.goalkicker.com/HTML5Book/
17- HTML5 CANVAS
https://books.goalkicker.com/HTML5CanvasBook/
18- iOS
https://books.goalkicker.com/iOSBook/
19- JAVA
https://books.goalkicker.com/JavaBook/
20- JAVA SCRIPT
https://books.goalkicker.com/JavaScriptBook/
21- jQuery
https://books.goalkicker.com/jQueryBook/
22- KOTLIN
https://books.goalkicker.com/KotlinBook/
23- LaTex
https://books.goalkicker.com/LaTeXBook/
24- Linux
https://books.goalkicker.com/LinuxBook/
25- MATLAB
https://books.goalkicker.com/MATLABBook/
26- Microsoft SQL Server
https://books.goalkicker.com/MicrosoftSQLServerBook/
27- MongoDB
https://books.goalkicker.com/MongoDBBook/
28- MySQL
https://books.goalkicker.com/MySQLBook/
29- NodeJS
https://books.goalkicker.com/NodeJSBook/
30- Objective-C
https://books.goalkicker.com/ObjectiveCBook/
31- Oracle DB
https://books.goalkicker.com/OracleDatabaseBook/
32- Perl
https://books.goalkicker.com/PerlBook/
33- PHP
https://books.goalkicker.com/PHPBook/
34- PostgreSQL
https://books.goalkicker.com/PostgreSQLBook/
35- PowerShell
https://books.goalkicker.com/PowerShellBook/
36- Python
https://books.goalkicker.com/PythonBook/
37- R Book
https://books.goalkicker.com/RBook/
38- React JS
https://books.goalkicker.com/ReactJSBook/
39- React Native
https://books.goalkicker.com/ReactNativeBook/
40- Ruby
https://books.goalkicker.com/RubyBook/
41- Ruby on Rails
https://books.goalkicker.com/RubyOnRailsBook/
42- Spring Framework
https://books.goalkicker.com/SpringFrameworkBook/
43- SQL
https://books.goalkicker.com/SQLBook/
44- Swift
https://books.goalkicker.com/SwiftBook/
45- Type Script
https://books.goalkicker.com/TypeScriptBook2/
46- VBA
https://books.goalkicker.com/VBABook/
47- Visual Basic .Net
https://books.goalkicker.com/VisualBasic_NETBook/
48- Xamarin Forms
https://books.goalkicker.com/XamarinFormsBook/
@PrimeStudyBox
#Programming
#Books
1- .NET FRAMEWORK-
https://books.goalkicker.com/DotNETFrameworkBook/
2- Algorithms-
https://books.goalkicker.com/AlgorithmsBook/
3- Android-
https://books.goalkicker.com/AndroidBook/
4- Angular 2
https://books.goalkicker.com/Angular2Book/
5- Angular JS
https://books.goalkicker.com/AngularJSBook/
6- BASH
https://books.goalkicker.com/BashBook/
7- C
https://books.goalkicker.com/CBook/
8- C++
https://books.goalkicker.com/CPlusPlusBook/
9- C#
https://books.goalkicker.com/CSharpBook/
10- CSS
https://books.goalkicker.com/CSSBook/
11- Entity Framework-
https://books.goalkicker.com/EntityFrameworkBook/
12- Excel VBA
https://books.goalkicker.com/ExcelVBABook/
13- GIT
https://books.goalkicker.com/GitBook/
14- Haskell
https://books.goalkicker.com/HaskellBook/
15- Hibernate
https://books.goalkicker.com/HibernateBook/
16- HTML 5
https://books.goalkicker.com/HTML5Book/
17- HTML5 CANVAS
https://books.goalkicker.com/HTML5CanvasBook/
18- iOS
https://books.goalkicker.com/iOSBook/
19- JAVA
https://books.goalkicker.com/JavaBook/
20- JAVA SCRIPT
https://books.goalkicker.com/JavaScriptBook/
21- jQuery
https://books.goalkicker.com/jQueryBook/
22- KOTLIN
https://books.goalkicker.com/KotlinBook/
23- LaTex
https://books.goalkicker.com/LaTeXBook/
24- Linux
https://books.goalkicker.com/LinuxBook/
25- MATLAB
https://books.goalkicker.com/MATLABBook/
26- Microsoft SQL Server
https://books.goalkicker.com/MicrosoftSQLServerBook/
27- MongoDB
https://books.goalkicker.com/MongoDBBook/
28- MySQL
https://books.goalkicker.com/MySQLBook/
29- NodeJS
https://books.goalkicker.com/NodeJSBook/
30- Objective-C
https://books.goalkicker.com/ObjectiveCBook/
31- Oracle DB
https://books.goalkicker.com/OracleDatabaseBook/
32- Perl
https://books.goalkicker.com/PerlBook/
33- PHP
https://books.goalkicker.com/PHPBook/
34- PostgreSQL
https://books.goalkicker.com/PostgreSQLBook/
35- PowerShell
https://books.goalkicker.com/PowerShellBook/
36- Python
https://books.goalkicker.com/PythonBook/
37- R Book
https://books.goalkicker.com/RBook/
38- React JS
https://books.goalkicker.com/ReactJSBook/
39- React Native
https://books.goalkicker.com/ReactNativeBook/
40- Ruby
https://books.goalkicker.com/RubyBook/
41- Ruby on Rails
https://books.goalkicker.com/RubyOnRailsBook/
42- Spring Framework
https://books.goalkicker.com/SpringFrameworkBook/
43- SQL
https://books.goalkicker.com/SQLBook/
44- Swift
https://books.goalkicker.com/SwiftBook/
45- Type Script
https://books.goalkicker.com/TypeScriptBook2/
46- VBA
https://books.goalkicker.com/VBABook/
47- Visual Basic .Net
https://books.goalkicker.com/VisualBasic_NETBook/
48- Xamarin Forms
https://books.goalkicker.com/XamarinFormsBook/
@PrimeStudyBox
#Programming
#Books
Goalkicker
Free .NET Framework Book
Getting started with .NET Framework, Strings, DateTime parsing, Dictionaries, Collections, ReadOnlyCollections, Stack and Heap, LINQ, ForEach, Reflection, Expression Trees, Custom Types, Code Contracts, Settings, Regular Expressions (System.Text.RegularExpressions)…