0
Q:

public abstract class Shape {

private int x;

private int y;

public abstract void draw();

public void setAnchor(int x, int y) {

this.x = x;

this.y = y;

}

}

Which two classes use the Shape class correctly?

A) public class Circle implements Shape { private int radius; B) public abstract class Circle extends Shape { private int radius; }
C) public class Circle extends Shape { private int radius; public void draw(); D) None

Answer:   B) public abstract class Circle extends Shape { private int radius; }



Explanation:

Only B is true

Subject: Java
Q:

How to do MultiThreading in Java?

Answer

To do multi threading in java we use interfaces and classes defined in java.lang package.


Those classes and interfaces are:


Java.lang.Runnable, Java.lang. Thread, Java.lang.ThreadGroup

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1712
Q:

What is MultiThreading?

Answer

Executing two or more blocks (threads) of a program at a time is called MultiThreading.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2102
Q:

What is MultiTasking?

Answer

Executing more than one program simultaniously.(i.e at time)


Ex:


Windows media player  is a program


Internet explorer(IE) is another program executing both the programs  at a time is called multi tasking.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2012
Q:

What is Thread?

Answer

A Thread is a block of code that can be executed in parallel with another block of code.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2250
Q:

How to get contents of the folder?

Answer

File[] listFiles();


this method returns list of files stored in a directory.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1613
Q:

How to get last modified date of a file?

Answer

long lastModified();


we can give this return value to a date object and we can get data to be displayed.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1501
Q:

How to check that whether the file object is pointing a folder or not?

Answer

boolean isDirectory();

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1697
Q:

How to check that the file object is pointing a file on HD?

Answer

boolean isFile();

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1516