Difference Between Keywords And Literals
Jul 5, 2013
Keywords are the predefined definition known to compiler like public/static/void/class
And literals are String/init/double/char/ , so here for e.g. String , its also predefined class ..
So will it be right to say that literals are also keywords?
View Replies
ADVERTISEMENT
Feb 1, 2014
program to accept string
import java.util.Scanner;
public class accept_string{
public static void main(String[] args)
[code]...
I wrote this program.actually I copy it from webpage this website.Its very cool to wrote programs in java.but I did not understand meaning of string,scanner......
View Replies
View Related
Mar 17, 2014
I must be missing a bracket or an import somewhere in this small bit of code. What is wrong and why all my swing KeyWords are all getting errors.
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
public class list1 extend JFrame
{
private JPanel deckPanel;
private JPanel selectedDeckPanel;
private JPanel deckList;
[Code] .....
View Replies
View Related
Jan 23, 2014
Which package or class i can find all the predefined keywords in java like "this" etc...
actually i want to know if this operator is itself final in nature or not from its syntax?
View Replies
View Related
Oct 26, 2014
Is there any way to add duplicate keywords (for all java keywords) maybe in a different language such that we can program java in a different language.
View Replies
View Related
Jun 11, 2014
I am wondering if there is a way in jave to use enums WITHIN a class (without creating a separate enum class) without using private static final. Something like as folows:
class My Class {
myEnum {ACTIVE, INACTIVE, PENDING};
}
is there something like this available?
View Replies
View Related
Feb 27, 2014
I'm not sure if that's the right place to ask
But I am a bit confused:
I know that JDK means "Java Development Kit" , but isn't Eclipse the same thing? (so why it's called "IDE"?)
Or maybe Eclipse is a type of JDK?
Or actually JDK and Eclipse are 2 different things
View Replies
View Related
Feb 11, 2015
What Is the difference between an ActionListener and an EventHandler ?
button.addActionListener(new ActionListener() {
button.setOnAction(new EventHandler<ActionEvent>() {
View Replies
View Related
Sep 19, 2014
exact difference between
1. unread fields
2. unused fileds
in java
View Replies
View Related
Dec 16, 2014
I am new to java i dont understand the difference between the abstract and inheritance i mean we use the abstract class with extends with other class name ,even we do that same in the inheritance pls tell me main difference between abstract and inheritance...
View Replies
View Related
Jul 11, 2014
how to program in Javascript, I am wondering what are the advantages and disadvantages OR pros/cons of using JS versus say a language like Java?
View Replies
View Related
Oct 19, 2014
I have been tasked with creating an invoice (school assignment). Part of the calculations is creating an interest depending on the amount of days between the current date entered, and invoice date entered (The program prompts the user to enter both the current and invoice dates by asking for the day, month and year).
We are also supposed to set the contructor to a default date of 1/1/1900.. but I don't know how or where to code that.
How to calculate the difference between the CurrentDate and Invoice. I have displayed the dates to the user as follows.
public void displayDate() {
System.out.println("
Today's Date: " + month + "/" + day + "/" + year);
}
public void displayInvDate() {
System.out.println("
Invoice Date: " + invMonth + "/" + invDay + "/" + invYear);
View Replies
View Related
Feb 19, 2014
I have just begin to understand collections in Java. I read about the differences between LinkedList and ArrayList but have several doubts on it. I have mentioned them below
1) Why retrieving in ArrayList is faster then LinkedList?. Since both have the get method how does performance differ?.
2) How does re-sizing happens internally in ArrayList when a item is added or removed?. How slow this is compared to the pointer re-shuffling in LinkedList when a item is added or removed?.
View Replies
View Related
Jul 11, 2014
I read that InputStream is used for byte based reading it reads 1 byte at a time.And InputStreamReader is used for charcter based reading so it reads one charcter at a time so no need to convert this first to int then read it.Here is reading using InputStream.
input=new FileInputStream("D:/input.txt");
int c;
while((c=input.read())!=-1)
{
System.out.print((char)c);
}
and here is reading using InputStreamReader
input=new FileInputStream("D:/input.txt");
reader=new InputStreamReader(input,"UTF-8");
int c;
while((c=reader.read())!=-1)
{
System.out.print((char)c);
}
so what is difference between InputStream and InputStreamReader in both case i have to use a Int and then read it and at the end if I want to print that data I have to cast that with "(char)c".So what is advantage of using InputStreamReader?
View Replies
View Related
Mar 28, 2015
I am new in java. Is there any difference between protected or default when we are talking about one package?
View Replies
View Related
Mar 12, 2015
I know jspf is a jsp fragment, but can't a tag also serve as a jsp fragment?
View Replies
View Related
Apr 13, 2014
Can explain difference between applet and application?
What are differences in code? How to write application?
What are differences in use? I looked for some answers, but I can't understand what they are talking about.
For example:
Application:
Called as stand-alone application as application can be executed from command prompt
Applet:
Requires some third party tool like a browser to execute
But... While I export applet in exclipse I can use it without any browser, just like application(as I and avarage user knows it).
Ok, I understand difference like "Applets cannot read from or write to hard disk files."
So. What should I use while creating what?
For example, something as simple as windows calc, some 2d simply platformer, some more expanded app, like idk, spotify or media player or whatever?
Since after update 51 of java web applets are nearly useless(as I know, maybe I'm wrong?), what is better?
Can application have GUI or it is only applets thing(stupid question?)?
Where can I find any application tutorial? Everything that I found was for applets. Why?
View Replies
View Related
Jan 28, 2014
I know that oracle has released a statement saying that JavaFX will eventually replace Swing. What is the advantage of JavaFX? The new format, using "stage" instead of JFrame, seemed weird. Why is this change necessary? What benefit do we reap from JavaFX that Swing does not have?
View Replies
View Related
Apr 17, 2014
Im working on my homework and it mentioned element for one exercise and an index in another, what is the difference, If Any, Between An Element And An Index?
View Replies
View Related
Jan 31, 2011
What is the difference between float and double?
View Replies
View Related
Jul 14, 2014
If I am making an application using Java SE8 and I use new concepts of JavaSE8 like "Lambda Expressions" and "Default Methods".
After completing my application I give it to client who are using Java Platform less than 8 like Jdk1.7._; then will this application will work fine as it is working on JavaSE8.
a JavaSE8 application works well on Java SE7 platform.
View Replies
View Related
Aug 13, 2014
I am reading a java book and find a theory about Interpreter and Compiler. explain different between them?
View Replies
View Related
Dec 5, 2013
I know this has been covered before but none of the answers made sense to me. I'm hoping there is an easy way to do this. I have 2 user inputted strings that I have converted to dates and I just want the difference in days.
My code :
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.Scanner;
import java.text.ParseException;
public class DateTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws ParseException {
[Code] ....
Apparently I can't just subtract the dates like I would in VB.
View Replies
View Related
Dec 2, 2014
But while searching i came across 2 different implementation.. One is this and other is this , where httpget is used..
So are these same ? When we talk about Restful, is the 2nd implementation valid ?
View Replies
View Related
Jan 29, 2014
I have finished a Java 101 class but the most we did was create a gui for a timer program. I figure I need more training and every book I pick up wants to teach me hello world and the difference between a class and object again.
View Replies
View Related
Jun 4, 2014
I know instanceof is an operator and println is a method. But what is the difference between the two? How are they different/same?
View Replies
View Related