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)…
public class Program
{
public static String toString(){ System .out.println("Hello"); return ""; } public static void main(String[] args) { System.out.println(toString ); } }
{
public static String toString(){ System .out.println("Hello"); return ""; } public static void main(String[] args) { System.out.println(toString ); } }
Anonymous Quiz
33%
Hello
33%
Compile time error
23%
Program@7fh2bd8(object class toString method is being called)
10%
No Output
Consider the two methods (within the same class)
public static int foo(int a, String s)
{
s = "Yellow";
a=a+2;
return a;
}
public static void bar()
{
int a=3;
String s = "Blue";
a = foo(a,s);
System.out.println("a="+a+" s="+s);
}
public static void main(String args[])
{
bar();
}
What is printed on execution of these methods?
public static int foo(int a, String s)
{
s = "Yellow";
a=a+2;
return a;
}
public static void bar()
{
int a=3;
String s = "Blue";
a = foo(a,s);
System.out.println("a="+a+" s="+s);
}
public static void main(String args[])
{
bar();
}
What is printed on execution of these methods?
Mastering OOP: A Practical Guide To Inheritance, Interfaces, And Abstract Classes — Smashing Magazine
https://www.smashingmagazine.com/2019/11/guide-oop-inheritance-interfaces-abstract-classes/
https://www.smashingmagazine.com/2019/11/guide-oop-inheritance-interfaces-abstract-classes/
Smashing Magazine
Mastering OOP: A Practical Guide To Inheritance, Interfaces, And Abstract Classes — Smashing Magazine
Arguably the worst way to teach the fundamentals of programming, is to describe what something is, without mention of how or when to use it. In this article, Ryan M. Kay discusses three core concepts in OOP.
public class Program
{
private int num; private Program(){ System.out.print("Constructor"); num=5; } public static void main(String[] args) { Program p=new Program(); System.out.println(p.num); } }
{
private int num; private Program(){ System.out.print("Constructor"); num=5; } public static void main(String[] args) { Program p=new Program(); System.out.println(p.num); } }
Anonymous Quiz
32%
Compile Time Error
14%
0
55%
Constructor 5
0%
No Output
public class Program
{
public static void main(String[] args) { int t; System.out.println(t); } }
{
public static void main(String[] args) { int t; System.out.println(t); } }
Anonymous Quiz
39%
0
35%
Compile Time Error
17%
Runtime Error
9%
None Of the Above
JAVA Cheat Sheet. A cheat-sheet for reading right before… | by Anjali Viramgama | Nov, 2020 | Medium
https://medium.com/@anjaliviramgama/java-cheat-sheet-4b1ce58967e9
https://medium.com/@anjaliviramgama/java-cheat-sheet-4b1ce58967e9
Medium
JAVA Cheat Sheet
A cheat-sheet for reading right before an interview, or while solving programming questions in JAVA.
Functionality of multiple inheritance can be implemented in java by
A) Extending one class and implementing multiple Interfaces
B)Implementing multiple Interfaces C)Extending multiple classes and interfaces D)Extending multiple classes and one Interface
A) Extending one class and implementing multiple Interfaces
B)Implementing multiple Interfaces C)Extending multiple classes and interfaces D)Extending multiple classes and one Interface
Anonymous Quiz
37%
Only A
11%
Only B
26%
A & B
26%
B & C
Which of the following variable declaration would NOT compile in a java program?
Anonymous Quiz
0%
int var;
4%
int VAR;
8%
int var1;
4%
int var_1;
85%
int 1_var;
Consider the following class definition:
public class MyClass
{
private int value;
public void setValue(int i){ /* code */ }
// Other methods...
}
The method setValue assigns the value of i to the instance field value. What could you write for the
implementation of setValue?
(a) value = i;
(b) this.value = i;
(c) value == i;
(d) Both (A) and (B) and above
(e) (A), (B) and (C) above.
public class MyClass
{
private int value;
public void setValue(int i){ /* code */ }
// Other methods...
}
The method setValue assigns the value of i to the instance field value. What could you write for the
implementation of setValue?
(a) value = i;
(b) this.value = i;
(c) value == i;
(d) Both (A) and (B) and above
(e) (A), (B) and (C) above.
Which of the following is TRUE?
Anonymous Quiz
0%
In java, an instance field declared public generates a compilation error.
6%
int is the name of a class available in the package java.lang
24%
Instance variable names may only contain letters and digits.
65%
A class has always a constructor (possibly automatically supplied by the java compiler).
6%
The more comments in a program, the faster the program runs.
Consider,
public class MyClass
{ public MyClass(){/*code*/} // more code... } To instantiate MyClass, you would write?
public class MyClass
{ public MyClass(){/*code*/} // more code... } To instantiate MyClass, you would write?
Anonymous Quiz
65%
(a) MyClass mc = new MyClass();
6%
(b) MyClass mc = MyClass();
6%
(c) MyClass mc = MyClass;
12%
(d) MyClass mc = new MyClass;
12%
(e) The constructor of MyClass should be defined as, public void MyClass(){/*code*/}.
7 Hacks to become a better Java problem-solver | TechGig
https://content.techgig.com/7-hacks-to-become-a-better-java-problem-solver/articleshow/79468180.cms
https://content.techgig.com/7-hacks-to-become-a-better-java-problem-solver/articleshow/79468180.cms
TechGig
7 Hacks to become a better Java problem-solver
By Kajal Garg For a Java developer, transforming into a professional programmer is not that tricky and the most expected quality to become one is to detect