Questions tagged [scjp]

SCJP is a certification for programmers experienced using the Java programming language. SCJP affirms that the programmer really knows how to code in Java. However the ability to design and implement a complete application is not affirmed by this test (it is affirmed by the second step certification, SCJD).

SCJP (Sun Certified Java Programmer) is a certification for programmers experienced using the Java programming language. Achieving this certification provides clear evidence that a programmer understands the syntax and structure of the Java programming language and knows enough about J2SE system library.

During the test, the programmer needs to solve multiple short programming tasks in a limited time. Unlike the second level (SCJD) test, the SCJP test does not require to implement and demonstrate a complex working application.

285 questions
-2
votes
1 answer

Java - Choosing the right collection

Possible Duplicate: Rule of thumb for choosing an implementation of a Java Collection? I am looking for a 'Summary' list of all the Java collections detailing the pros and cons of each. I am particularly interested in things like Which provide…
ziggy
  • 15,677
  • 67
  • 194
  • 287
-2
votes
1 answer

OCJP Dumps Thread

Can anyone help me to solve the following problem? public class Starter extends Thread{ private int x=2; public static void main(String[] args) throws Exception{ new Starter().makeItSo(); } public Starter(){ x=5; …
Dengke Liu
  • 131
  • 1
  • 1
  • 10
-2
votes
4 answers

post-decrement (y--) values in java

This question is from SCJP int x = 0; int y = 10; do { y--; ++x; } while (x < 5); System.out.print(x + "," + y); What is the result? A. 5,6 B. 5,5 C. 6,5 D. 6,6 ANSWER is B but i was wondering why its not A. because we know…
user2985842
  • 437
  • 9
  • 24
-2
votes
1 answer

Need more explanation for finalize(), sample exam

Given: class Finalizer { static int x = 0; static boolean gc = false; public static void main(String[] args) { for(x=0; x<100000; x++) { new Finalizer().finalize(); } x = 0; gc = true; …
-2
votes
2 answers

args [] of main takes only ten elements?

In a video of the Oracle University for Java certification, the instructor just said that "the size of args is ten, so we can only send a maximum of ten elements". Has anybody heard of this? I just tried it and it doesn't seem right. package…
Luis Sep
  • 2,384
  • 5
  • 27
  • 33
-3
votes
1 answer

PrintWriter and PrintStream methods?

PrintStream write() overloaded methods of PrintStream print() overloaded methods of PrintStream PrintWriter write() overloaded methods of PrintWriter print() overloaded methods of PrintWriter I don't understand that if both write() method and…
-3
votes
1 answer

Type conversion to double value in java

public class TypeConversion4 { public static void main(String[] args) { double d = 2D + 2d + 2. + 2l + 2L + 2f + 2F + 2.f + 2.D; System.out.println(d); //prints 18.0 } } how it prints 18.0. Can anyone provide some analysis.
kittu
  • 6,662
  • 21
  • 91
  • 185
-3
votes
1 answer

Relation between equals() method and == operator

I know that == operator is applicable for content comparison for primitive types and reference comparison for objects. Similarly, .equals() method of object class is for reference comparison of objects and content comparison in strings and wrapper…
kittu
  • 6,662
  • 21
  • 91
  • 185
-3
votes
2 answers

how read() method is executing twice

But i dont understand why its a? why read() method is executing twice? import java.io.*; public class asrts{ public static void main(String argv[])throws Exception{ StringReader sr=new StringReader("Kavp"); sr.read(); char…
user2985842
  • 437
  • 9
  • 24
-4
votes
2 answers

Java. Method Inner Object as return type

Can I return method local inner object from method? public class myClass { public MyMethodInnerClass getMethodInnerClassObject() { class MyMethodInnerClass { } MyMethodInnerClass myMethodClass = new…
Benas
  • 2,106
  • 2
  • 39
  • 66
-4
votes
1 answer

Regular Expression program from Predefined character classes

public class RegularExpressionDemo2 { public static void main(String[] args) { Pattern p = Pattern.compile("\\."); Matcher m = p.matcher("a1b7 @z#"); while (m.find()) { System.out.println(m.start() +…
kittu
  • 6,662
  • 21
  • 91
  • 185
-4
votes
1 answer

A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system

I need help understanding this problem The correct answer is 'C' A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system using the command: java…
Amit2311
  • 93
  • 1
  • 7
-4
votes
2 answers

how to declare variable like this-- ArrayList LinkedhashMap

how to declare variable like this-- ArrayList LinkedhashMap.
Derek
  • 1,177
  • 3
  • 11
  • 26
-5
votes
5 answers

why it throws StackOverflowError?

public class ClassA { public void count(int i) { count(++i); //throws StackOverFlowError } public static void main(String[] args) { ClassA a = new ClassA(); a.count(3); …
kittu
  • 6,662
  • 21
  • 91
  • 185
-8
votes
2 answers

Questions about a Java beginners

How to call? How to do? public class Test { public static void main(String[] args) { Test test = new Test(); Animal a = new Animal("Animal"); Dog d = new Dog(" BigDog ","yellow"); Cat c = new…
aca
  • 25
  • 3
1 2 3
18
19