Back
Close

Computing with Data

elgeish
148.3K views
Previous: Types, Variables, and Scope Next: Arrays

Primitive and Non-Primitive Types

import java.util.Date;
public class DateExample {
public static void main(final String[] args) {
final Date date1 = new Date(); // define a new object date1
final Date date2 = date1; // point date2 to date1
// print both objects
System.out.println(date1);
System.out.println(date2);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants