Java SCJP 8

Java SCJP Cert Fragen

Java SCJP Cert Fragen

Lukas Badertscher
Study

Lukas Badertscher
This flashcard set covers advanced Java programming concepts at a university level, focusing on topics like classes, methods, and keywords. It delves into the intricacies of Java syntax, including the use of static methods, packages, and source files. The set also explores the Java Virtual Machine (JVM) and its memory management, particularly the stack and heap. It is designed for students and professionals aiming to master Java programming, providing a comprehensive review of key concepts and practical examples to enhance understanding and application.
Flashcards
200
Students
4
Language
English
Category
Computer Science
Level
University
Created / Updated
29.01.2014 / 27.03.2020

Flashcards

Which are valid Source File Declaration Rules?

Which are valid Source File Declaration Rules?

Which are valid Source File Declaration Rules?

Which are valid Source File Declaration Rules?

Which are valid Source File Declaration Rules?

Which are valid Source File Declaration Rules?

Which are valid Source File Declaration Rules?

Which are access modifiers?
Which are access modifiers?
Which are access modifiers?
Which are valid interface modifiers?

Which are valid interface modifiers?

Which are valid interface modifiers?
Which are valid interface modifiers?
Is it allowed to declare a constants right in the interface
Which are valid interface constants declaration?

Which are valid determining Access to Class Members? "From the same class"

Which are valid determining Access to Class Members? "From any class in the same package"

Which are valid determining Access to Class Members? "From subclass in the same package"

Which are valid determining Access to Class Members? "From a subclass outside the same package"

Which are valid determining Access to Class Members? "From any non-subclass class outside the package"

What will the following code print when run?

public class TestClass{
  public static long main(String[] args){
     System.out.println("Hello");
     return 10L;
  }
}

Which statement would designate that your file belongs in the package com.ocajexam.utilities?

Which of the following it the only Java package that is imported by default?

The Java-Basic I/O API contains what types of classes and interfaces?

Which usage represents a valid way of compiling a Java class?

Which command-line invocations of the Java interpreter return the version of the interpreter?

Which command-line usages appropriately identify the classpath?

Following valid sentens are valid for an constructor?

Following valid sentens are valid for an constructor?

Which method names follow the JavaBeans standard?

Which method names follow the JavaBeans standard?

Which, inserted independently at line 6, will compile? (Choos all that apply.)

Given:

1.  class Vood {

2.     public static void main( String [] args ) {

3.         doStuff(1);

4.         doStuff( 1,2);

5.    }

6.  // INSERT CODE HERE

7. }

(Lösung: SCJP 6, Seite 80)

What is the result?

Given:

1. package pkgA;

2. public class Foo {

3.     int a = 5;

4.     protected int b = 6;

5.     public int c = 7;

6. }

 

3.  package pkgB;

4.  import pkgA.*;

5. public class Baz {

6.     public static void main( String[] args) {

7.           Foo f = new Foo();

8.           System.out.print(" " + f.a );

9.           System.out.print(" " + f.b );

10.         System.out.print(" " + f.c );

11.       }

12. }

(Lösung: SCPJ 6, Seite 81)

What is the result? (Choos all that apply.)

Given:

4. class Announce {

5.    public static void main(String[] args) {

6           for(int __x = 0; __x < 3; __x++ );

7.          int #lb = 7;

8.          long [] x [5];

9.          Boolean []ba[];

10.        enum Traffic { RED, YELLOW, GREEN };

11.     }

12. }

(Lösung: SCJP 6, Seite 82)

What is the result? (Choos all that apply.)

Given:

4. class Announce {

5.    public static void main(String[] args) {

6.          int 8lb = 7;

7.          enum Traffic { RED, YELLOW, GREEN };

8.         Boolean []ba[][];

9.          long [] x [5];

11.     }

12. }

(Lösung: SCJP 6, Seite 82)

What is the result? (Choos all that apply.)

Given:

4. public class Frodo extends Hobbit {

5.     public static void main(String[] args) {

6.         Short myGold = 7;

7.         System.out.println( countGold( myGold, 6));

8.     }

9. }

10. class Hobit {

11.    int countGold(int x, int y ) { return x + y; }

12. }

(Lösung: SCJP 6, Seite 82)

What is the result if go() will be executed?

1.  interface Foo {
2.      int BAR = 42;
3.      void go();
4.  }

6.  class Zap implements Foo {
7.      public void go(){
8.          BAR = 37;
9.      }
10.    public static void main(String[] args) {

11.          new Zap().go();

12.   }

Which code lines compile?

Which code lines compile?

Study