search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Recent questions and answers in Java

1 vote
3 answers
1
What is the output of the following JAVA program? class simple { public static void main(String[ ] args) { simple obj = new simple(); obj.start(); } void start() { long [] P = {3, 4, 5}; long [] Q = method (P); System.out.print (P[0] + P[1] +P[2]+”:”); System.out.print (Q[0] + Q[1] + Q[2]); } long [ ] method (long [ ] R) { R[1] = 7; return R; } } //end of class 12:15 15:12 12:12 15:15
answered Jul 21, 2020 in Java PinkiSharma 1.8k views
1 vote
2 answers
2
What is the output of the following JAVA program? public class Good { private int m; public Good (int m){this.m=m;} public Boolean equals (Good n) {return n.m==m;} public static void main (string args[]){ Good m1 = new Good(22); Good m2 = new Good(22); Object ... .out.println(s1.equals(m2)); } } True, True, False, False True, False, True, False True, True, False, True True, False, False, False
answered Jul 14, 2020 in Java PinkiSharma 667 views
0 votes
1 answer
3
0 votes
1 answer
5
1 vote
1 answer
6
Which of the following is/are true about packages in Java? Every class is part of some package. All classes in a file are part of the same package. If no package is specified, the classes in the file go into a special unnamed package. If no package is specified, a new package is created with folder ... class is put in this package. Only $1,2$ and $3$ Only $1,2$ and $4$ Only $4$ Only $1$ and $3$
answered Mar 30, 2020 in Java smsubham 149 views
1 vote
1 answer
7
Which of the following is false about abstract classes in Java? If we derive an abstract class and do not implement all the abstract methods, then the derived class should also be marked as abstract using 'abstract' keyword. Abstract classes can have constructors. A class can be made abstract without any abstract method. A class can inherit from multiple abstract classes.
answered Mar 30, 2020 in Java smsubham 519 views
2 votes
1 answer
8
Which of the following is true about interfaces in Java? An interface can contain following type of members. $\dots$ public, static, final fields(i.e., constants)$\dots$default and static methods with bodies. An instance of interface can be created. A class can implement multiple interfaces. Many classes can implement the same interface. $1,3$ and $4$ $1,2$ and $4$ $2,3$ and $4$ $1,2,3$ and $4$
answered Mar 30, 2020 in Java smsubham 426 views
5 votes
3 answers
9
In Java, after executing the following code what are the values of x, y and z? int x,y=10; z=12; x=y++ + z++; x=22, y=10, z=12 x=24, y=10, z=12 x=24, y=11, z=13 x=22, y=11, z=13
answered Jan 5, 2020 in Java swapnilbaviskar10 2.3k views
2 votes
3 answers
10
Java uses threads to enable the entire environment to be ______. Symmetric Asymmetric Synchronous Asynchronous
answered Aug 26, 2019 in Java Shailendra_ 1.3k views
1 vote
2 answers
11
Which methods are utilized to control the access to an object in multi-threaded programming ? Asynchronized methods Synchronized methods Serialized methods None of the above
answered Mar 1, 2019 in Java Gurdeep Saini 1.6k views
0 votes
0 answers
12
1 vote
2 answers
13
Match the following interfaces of Java. Servlet package : \begin{array}{|l|l|l|l|l|}\hline & \textbf{List-I} && \textbf{List-II}\\\hline \text{a.}& \text{Servlet config} & \text{i} & \text{Enables servelt to log events} \\ \hline\text{b.}& \text{Servlet Context} & \text{ii.} & \text{Read data from a ... -iii, b-iv, c-ii, d-i a-iii, b-ii, c-iv, d-i a-ii, b-iii, c-iv, d-i a-iv, b-i, c-ii, d-iii
answered May 19, 2018 in Java Prasanjeet Ghosh 980 views
1 vote
3 answers
14
we know that pointer implementation is not possible in java and dynamic memory allocation is also not possible.Then how we can implement linked list in java?
answered Oct 30, 2017 in Java smsubham 251 views
3 votes
4 answers
15
Which of these is a super class of all errors and exceptions in the Java language? Runtime Exceptions Throwable Catchable None of the above
answered Sep 16, 2017 in Java rishu_darkshadow 4.4k views
0 votes
3 answers
16
Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x<100) x = CBSE(x+10); return(x-1); } public static void main (String[] args) { System.out.print(First.CBSE(60)); } } What does this program print? 59 95 69 99
answered Sep 15, 2017 in Java navya n 2.8k views
2 votes
2 answers
17
Which of the following statements is correct? Every class containing abstract method must not be declared abstract Abstract class cannot be directly initiated with new operator Abstract class cannot be initiated Abstract class contains definition of implementations
answered Sep 13, 2017 in Java rishu_darkshadow 2.9k views
1 vote
2 answers
18
Method over-riding can be prevented by using final as a modifier at ______. The start of the class. The start of method declaration. The start of derived class. The start of the method declaration in the derived class.
answered Aug 27, 2017 in Java rishu_darkshadow 1.3k views
2 votes
3 answers
19
Consider the following Java code fragment: public class While { public void loop() { int x = 0; while(1) { System.out.println("x plus one is" +(x+1)); } } } There is syntax error in line no. 1 There is syntax errors in line nos. 1 & 6 There is syntax error in line no. 8 There is syntax error in line no. 6
answered Apr 5, 2017 in Java Regina Phalange 2.7k views
1 vote
1 answer
20
Which of the following is not a correct statement ? Every class containing abstract method must be declared abstract. Abstract class can directly be initiated with ‘new’ operator. Abstract class can be initiated. Abstract class does not contain any definition of implementation.
answered Oct 1, 2016 in Java Sanjay Sharma 504 views
2 votes
1 answer
21
Which method is called first by an applet program ? start( ) run( ) init( ) begin( )
answered Jul 29, 2016 in Java Sanjay Sharma 726 views
1 vote
1 answer
22
Converting a primitive type data into its corresponding wrapper class object instance is called Boxing Wrapping Instantiation Autoboxing
answered Jul 28, 2016 in Java LavTheRawkstar 1.2k views
1 vote
1 answer
23
Which of the following methods from Object is final ( that it cannot be overriden ) ? (A) finalize method (B) clone method (C) hashCode method (D) getClass method
answered Jun 28, 2016 in Java Shubhi Tiwari 734 views
0 votes
1 answer
24
What is the output of this program? class Conversion { public static void main(String args[]) { double a = 295.04; int b = 300; byte c = (byte) a; byte d = (byte) b; System.out.println(c + " " + d); } } a) 38 43 b) 39 44 c) 295 300 d) 295.04 300
answered Jun 28, 2016 in Java Shubhi Tiwari 1.1k views
6 votes
2 answers
25
Find the output of the following Java code line System.out.printIn(math.floor(-7.4)) -7 -8 -7.4 -7.0
answered Jun 26, 2016 in Java kvkumar 2.6k views
3 votes
1 answer
26
The built-in base class in java, which is used to handle all exceptions is Raise Exception Error Throwable
answered Jun 5, 2016 in Java ManojK 2.7k views
3 votes
1 answer
27
What is the output of the following program? Class Test { public static void main (String [] args) { int x = 0; int y = 0 for (int z = 0; z < 5; z++) { if((++x >2)||(++y > 2)) { x++; } } System.out.printIn (x+ "" + y); } } 8 2 8 5 8 3 5 3
answered May 6, 2016 in Java rude 2.2k views
0 votes
1 answer
28
output: Ssihtllun sillun ehtllun elbatllun import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Codechef { public static void main (String[] args) throws java.lang.Exception { Codechef c=new Codechef(); String res=c.reverseword ... = ""; for(int i=0;i<arr.length; i++){ if(i>0) ans+=" "; ans+=arr[i]; } return ans; } }
answered Aug 16, 2015 in Java Mari Ganesh Kumar 155 views
Help get things started by asking a question.
...