Concept For Innerclass
Apr 3, 2014what does inner class do
View Replieswhat does inner class do
View RepliesI use Jade an I'm able to send messages. Now I try to send a Message with not only integers or strings as content but with another concept as content. Here I want to send a Message of the Media, which contains any number of Trackdata.(I left out the import and other blabla stuff cause i is working)
add(new ConceptSchema(MEDIAINFO), Mediainfo.class);
add(new ConceptSchema(TRACKDATA), Trackdata.class);
//Mediainfo
cs = (ConceptSchema) getSchema(MEDIAINFO);
cs.add(CURRENTTRACK, (PrimitiveSchema) getSchema(BasicOntology.INTEGER), ObjectSchema.MANDATORY);
cs.add(TRACKINFOS, (ConceptSchema) getSchema(TRACKDATA), 1 , ObjectSchema.UNLIMITED);
[code]....
I am not getting the concept of interfaces.I know they are used to implement multiple inheritances.I also know the example that we create an interface car with certain methods so that a class like bmw which implements the car interface has to implement these methods.But I don't know how interfaces come handy?I don't know the meaning of a class calls a method using an interface?(i know that an interface can not be instantiated).
View Replies View RelatedI am having a hard time trying to understand interface concept.
-what is an interface?
-What the use of an interface?
-what does implement or to implement means?
-What does implementation means?
I know that static method cannot use non-static methods .Then how the following code works ,where main method is static and this main method calls go() method which is a non-static method .
import javax.swing.*;
import java.awt.event.*;
public class SimpleGuib implements ActionListener {
JButton button;
public static void main(String[] args) {
SimpleGuib gui = new SimpleGuib() ;
gui.go() ;
[code]....
I am having some difficulties grasping the concept of throwing your own exceptions. How do I get this to repeatedly ask the user to enter a valid value for hours. Also i am having difficulties in the method with using the throw new InvalidHrExcep("That value is invalid"); i cannot get this to work.
public class exceptionProgram {
static Scanner console = new Scanner(System.in);
public static void main(String[] args) throws InvalidHrExcep
{
int day=0;
int month = 0;
int year=0;
int hours=0;
int minutes=0;
int seconds=0;
[code]...
Any brief introduction about session in java....
View Replies View RelatedPrompt: Write a class encapsulating the concept of a circle, assuming a circle has the following attributes: a Point representing the center of the circle, and the radius of the circle, and integer.
Include a constructor, the accessors and mutators, and methods toString and equals.
Also include methods returning the perimeter ( 2 x ๐ x ๐ ) and area ( ๐ x ๐^2) of the circle.
Write a client (application) class to test all the methods in your class. I started out trying to thing how to do this and I mapped out a certain idea but do not know how to incorporate the point represent the center of the circle. I am not sure how to proceed further..
import java.awt.*;
public class Circle {
ย public static void main(String[] args) {
ย
final double PI = 3.14;
int x,y, radius = 4;
double area;
double perimeter;
ย
[Code] ...