What is the difference between length() and size() of ArrayList?
Anonymous Quiz
19%
length() and size() return the same value
24%
length() is not defined in ArrayList
10%
size() is not defined in ArrayList
47%
length() returns capacity of ArrayList and size() returns actual number of elements stored in list
public class Program
{
public static void main(String[] args) { String s="I LIKE JAVA"; System.out.println(s.charAt(3)); } }
{
public static void main(String[] args) { String s="I LIKE JAVA"; System.out.println(s.charAt(3)); } }
Anonymous Quiz
42%
I
34%
L
22%
K
3%
E
The "all-or-none" property commonly known as
Anonymous Quiz
22%
Isolation
11%
Durability
30%
Atomicity
37%
All the above
When an array is passed to a method, will the content of the array undergo changes with the actions carried within the function?
Anonymous Quiz
70%
True
30%
False
public class VarArgs
{
public static void print(Object... obj){
System.out.println("Object...:"+obj[0]);
}
public static void main(String[] args) {
//(1) Method call here)
}
}
Which Method call, when inserted at (1), will not result in the following output from the program:
Object...: 9
{
public static void print(Object... obj){
System.out.println("Object...:"+obj[0]);
}
public static void main(String[] args) {
//(1) Method call here)
}
}
Which Method call, when inserted at (1), will not result in the following output from the program:
Object...: 9
Given the following declaration, which expression return the size of the array, assuming the array has been initialized? Select the one correct answer.
int[] array;
int[] array;
Anonymous Quiz
24%
array[].length()
14%
array.length()
17%
array[].length
26%
array.length
5%
array[].size()
14%
array.size()
Given the following code which statement is true?
public class Program
{
public static void main(String[] args) {
int k=0;
int l=0;
for(int i=0;i<=3;i++){
k++;
if(i==2){
break;
}
l++;
}
System.out.println(k+" "+l);
}
}
public class Program
{
public static void main(String[] args) {
int k=0;
int l=0;
for(int i=0;i<=3;i++){
k++;
if(i==2){
break;
}
l++;
}
System.out.println(k+" "+l);
}
}
Options for above question
Anonymous Quiz
10%
The Program will fail to compile
22%
The Program will print 3 3 , when run
42%
The Program will print 4 3 ,when run, if break is replaced by continue
18%
The Program will fail to compile of break is replaced by return
8%
The Program will fail to compile of break is replaced by empty statement
How to use the Throws keyword in Java (and when to use Throw)
https://rollbar.com/blog/how-to-use-the-throws-keyword-in-java/
https://rollbar.com/blog/how-to-use-the-throws-keyword-in-java/
Rollbar
How to use the Throws keyword in Java (and when to use Throw)
Both throw and throws are concepts of exception handling in Java. The throws keyword is used to ..., while the throw keyword is used to explicitly...
Learn Java by building a classic arcade game | Opensource.com
https://opensource.com/article/21/3/java-object-orientation
https://opensource.com/article/21/3/java-object-orientation
Opensource
Learn Java by building a classic arcade game
As a second-semester student in systems and digital media at the Federal University of Ceará in Brazil, I was given the assignment to remake the classic Atari 2600
Consider the following Java Interface:
interface Pet{
void play();
} Suppose we want to code the Dog class, which is not an abstract class, and implement the pet interface. Which of the following actions needs to be performed in the given scenario? Choose the best options: A) Declare the Dog class to extend the Pet interface and override the abstract method play. B) State "Dog implements Pet" in the class declaration. The play method is automatically inherited from the pet interface. C) State "Dog implements Pet" in the class declaration and provides an implementation for the play method in the code of Dog class. D) Implement the play method in the Dog class. The Java compiler automatically deduces that the class Dog implements the corresponding interface.
interface Pet{
void play();
} Suppose we want to code the Dog class, which is not an abstract class, and implement the pet interface. Which of the following actions needs to be performed in the given scenario? Choose the best options: A) Declare the Dog class to extend the Pet interface and override the abstract method play. B) State "Dog implements Pet" in the class declaration. The play method is automatically inherited from the pet interface. C) State "Dog implements Pet" in the class declaration and provides an implementation for the play method in the code of Dog class. D) Implement the play method in the Dog class. The Java compiler automatically deduces that the class Dog implements the corresponding interface.
Determine the out of given code snippet?
public class Program
{
int i=1;
int j;
class B extends Program{//line 4
int k=3;//line 5
}
public static void main(String[] args) {
B.k=2;//line 8
System.out.println(i+" "+k);
}
}
public class Program
{
int i=1;
int j;
class B extends Program{//line 4
int k=3;//line 5
}
public static void main(String[] args) {
B.k=2;//line 8
System.out.println(i+" "+k);
}
}
public class Program
{
public static void main(String[] args) { int[] a1={1,2,3,4}; int[] a2=new int[5]; for(int i=0;i<a1.length;i++){ a2[i]=a1[i]; } System.out.println(a2[4]); } }
{
public static void main(String[] args) { int[] a1={1,2,3,4}; int[] a2=new int[5]; for(int i=0;i<a1.length;i++){ a2[i]=a1[i]; } System.out.println(a2[4]); } }
Anonymous Quiz
14%
0
29%
4
47%
ArrayIndexOutOfBoundException
10%
NullPointerException
The Full-Stack Independent Developer
https://flaviocopes.com/fullstack-indie-dev/
https://flaviocopes.com/fullstack-indie-dev/
Flaviocopes
The Full-Stack Independent Developer
When we think of a software developer, we imagine a person that’s always at the computer, focusing on creating some world-changing app, spending nights improving the performance of a software procedure, fixing bugs all day long, or trying to create the next…
IIT Bombay offering a free online course on Java for students and professionals | TechGig
https://content.techgig.com/iit-bombay-offering-a-free-online-course-on-java-for-students-and-professionals/articleshow/82027984.cms
https://content.techgig.com/iit-bombay-offering-a-free-online-course-on-java-for-students-and-professionals/articleshow/82027984.cms
TechGig
IIT Bombay offering a free online course on Java for students and professionals
IIT Bombay with the SWAYAM platform is offering a free online course on Java for IT professionals and students that wish to learn about the Java programming
10 Essential Java Interview Questions and Answers | Chegg Internships
https://www.internships.com/career-advice/interview/java-interview-questions-and-answers
https://www.internships.com/career-advice/interview/java-interview-questions-and-answers
Chegg Internships
10 Essential Java Interview Questions and Answers | Chegg Internships
If you're interviewing for a role in Java programming, here are the top 10 Java interview questions and answers to ace your interview.
500 SQL Interview Questions From Real Companies | StrataScratch
https://www.stratascratch.com/blog/500-sql-interview-questions-from-real-companies/
https://www.stratascratch.com/blog/500-sql-interview-questions-from-real-companies/
Stratascratch
500 SQL Interview Questions From Real Companies
A collection of real SQL interview questions from various industries for data scientists and business analysts.