Using Java Date class...

1 Answer

Answer :

answer:Date is deprecated because it isn’t locale aware. It was replaced with the Calendar family of classes. In order to create & populate an object representing a date in Java you can do something like: Calendar c [equal] new GregorianCalendar(2008, Calendar.FEBRUARY, 19); String s [equal] DateFormat.getDateInstance(DateFormat.SHORT).format(c.getTime()); or more generally: Calendar c [equal] Calendar.getInstance(); c.set(Calendar.YEAR, 2008); c.set(Calendar.MONTH, Calendar.FEBRUARY); c.set(Calendar.DATE. 19);

Related questions

Description : ______provides a powerful and natural mechanism for organizing and structuring your software. It also explains how classes inherit state and behavior from their super classes and explains how to derive one class ... the java programming language: a) Object b) Inheritance c) Class d) None of These

Last Answer : b) Inheritance

Description : International date line passes through which strait? A. Malacca Strait B. Adam Strait C. Bering Strait (Answer) D. Java Strait

Last Answer : C. Bering Strait (Answer)

Description : Ruby, a class XI student has just started learning java programming. Help her in the following: (i) Explain her the concept of variable -Technology

Last Answer : (i)Variables are named storage location to store values temporarily which can be changed during program execution.Data type states the way the values of that type are stored, the operations that can be done ... setText( Just Pass );In the above if statement, value of marks is being compared with 40.

Description : Explain the purpose of pow() method with the help of suitable java code. Also mention that pow() method belongs to which class? -Technology

Last Answer : pow() method, a mathematical method, helps in calculating the power of any number.For example:int num=2,power=4;int ans=Math.pow(num,power);t1.setText(''+ans);The above code will calculate the value of 24 and will give answer 16.pow() method belongs to math class.

Description : Ruby, a class XI student has just started learning java programming. Help her in the following: -Technology

Last Answer : i. Variables are named storage location to store values temporarily which can be changed during program execution.Data type states the way the values of that type are stored, the operations that can be done ... setText( Just Pass );In the above if statement, value of marks is being compared with 40.

Description : Each method in a java class must have a unique name . A) Not necessary B) True C) False D) None of the above

Last Answer : A) Not necessary

Description : Data input is A) an abstract class defined in java.io B) a class we can use to read primitive data types C) an interface that defines methods to open files. D) an interface that defines methods to read primitive data types.

Last Answer : D) an interface that defines methods to read primitive data types.

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : Data input is A) an abstract class defined in java.io B) a class we can use to read primitive data types C) an interface that defines methods to open files. D) an interface that defines methods to read primitive data types.

Last Answer : D) an interface that defines methods to read primitive data types.

Description : The concept of multiple inheritance is implemented in Java by A) extending two or more classes B) extending one class and implementing one or more interfaces C) implementing two or more interfaces D) both B and C

Last Answer : D) both B and C

Description : The class string belongs to ................... package. A) java.awt B) java.lang C) java.applet D) java.string

Last Answer : B) java.lang

Description : State true or false for Java Program. i) Data members of an interface are by default final ii) An abstract class has implementations of all methods defined inside it. A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : C) i-true, ii-false

Description : State true or false for Java Program. i) All class variables are instance variables ii) All protected methods are friendly methods A) i-false, ii-false B) i-false, ii-true

Last Answer : B) i-false, ii-true

Description : All java classes are derived from A) java.lang.Class B) java.util.Name C) java.lang.Object D) java.awt.Window

Last Answer : D) java.awt.Window

Description : Native – protocol pure Java converts ……….. into the ………… used by DBMSs directly. A) JDBC calls, network protocol B) ODBC class, network protocol C) ODBC class, user call D) JDBC calls, user call

Last Answer : A) JDBC calls, network protocol

Description : Which is the root class of all AWT events A) java.awt.ActionEvent B) java.awt.AWTEvent C) java.awt.event.AWTEvent D) java.awt.event.Event

Last Answer : B) java.awt.AWTEvent

Description : Which of the following statement(s) with regard to an abstract class in JAVA is/are TRUE? I. An abstract class is one that is not used to create objects. II. An abstract class is designed only to act as a base class ... by other classes. (1) Only l (2) Only II (3) Neither I nor II (4) Both l and II

Last Answer : Both l and II

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : What should I do so that I can learn Java in a fast and efficient manner?

Last Answer : Perhaps you could audit a course. Auditing isn’t as expensive, but you’ll still get the instruction.

Description : Just allowed Java to load on my machine. Is that a mistake?

Last Answer : No, you’re fine. Java is an essential component of many websites, and it’s as safe as houses.

Description : Can anyone coach me through how to use java on my Mac?

Last Answer : answer:You might want to start with Eclipse. This might help too. I haven't played with Java before but you might also need Xcode. It is free. I'm not sure if Eclipse has its own compiler or ... essentially what your instructor has done to you. This isn't high school. You are now a paying customer.

Description : What is hashcode in JAVA..?

Last Answer : answer:

Description : Why would I need Java on my PC?

Last Answer : Some websites and programs use it to run so if you get rid if it you may find somethings don’t work however I haven’t had java on my PC for years and never have any problems.

Description : Does knowing java make learning C/C++/Python easier? Which should I learn first?

Last Answer : answer:Learn Python first if you have no programming experience. The syntax is more human-friendly while still offering the features and speed of compiled languages (like Java and C). With ... speed up the learning process significantly. In what field will you be using your programming knowledge?

Description : How to use a Character in a Switch Statement (Java)

Last Answer : answer:Not a java guy so this is just a guess, but it looks like you need to put some quotes around your characters to identify them as strings. Right now I'd guess they're being treated as ... not being found. So instead of case a: use case a : Also remember case sensitivity with characters

Description : How do I run a .jar (java) application on my mac?

Last Answer : I had this problem before, it has something to do with the way JavaSun scripted Java for mac. I would say do a Spotlight for Java and see what comes up, if you don't get an App called Java ... more ideas, but the wrists are starting to hurt and I think I need to call it a night with typing.

Description : Necessary to upgrade JAVA?

Last Answer : It's definitely unnecessary... this last upgrade, if I recall, fixed the daylight savings time (that the US just changed). Regardless, you are probably never using java... and I'm sure the version you have will ... .) But Java truly won't make any difference to you. Don't update if it's a big pain.

Description : For begginers, is Java better than Python?

Last Answer : answer:I don't have any experience with Java, but I can say that Python is the cat's meow. Python is clean and easy to understand, has a zillion libraries you can take advantage of, and has some cool ... have friends who rave about Ruby, but I don't know it well enough to offer an opinion on it.

Description : What book(s) should I get for learning Java?

Last Answer : Can you clarify one thing before I answer. Are you looking to learn Java or Javascript? There’s a HUGE difference between them, so that’s why I’m asking.

Description : How can I use the reverse method of the string buffer using Java?

Last Answer : Show your attempt at using reverse() yourself, and one of us might help you fix/improve it. No one is going to write your homework for you.

Description : How do I program a neural network from scratch using Java?

Last Answer : There are many implementations of neural networks... What will you be using it for? I wrote a fairly simple one in college in Java just using basic data types. Can you give me some more info?

Description : Using Java Phone ... ? I want to know the rules for sending attachments with Gmail mail

Last Answer : If your Java phone has internet access then email must be sent. Set up Opera Mini on Java phone. Then with Opera Mini you can go to gmail.com or yahoo.com and send email like computer. For that, you must open the computer version in the browser.

Description : Where can I find a free website maker than help me design a site using Java?

Last Answer : WebSource.net is a distributor of tutorials that focus specifically on the Java platform. Programming a website in Java is a fairly advanced route to go, and it would serve you well to learn the basics of Java and how to code before taking a big step and building a site of your own.

Description : To send objects across the wire, beans need to be encoded using the Java Architecture for XML Binding (JAXB). a) True b) False

Last Answer : True

Description : The number of function points of a proposed system is calculated as 500. Suppose that the system is planned to be developed in Java and the LOC/FP ratio of Java is 50. Estimate the effort (E) required to ... ) 25 person months (B) 75 person months (C) 62.5 person months (D) 72.5 person months

Last Answer : (C) 62.5 person months